home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 008 / em38idoc.arc / EMACS.PRN < prev    next >
Encoding:
Text File  |  1987-04-28  |  112.9 KB  |  4,225 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.         MicroEMACS
  19.  
  20.         Full Screen Text Editor
  21.         Reference Manual (preliminary draft)
  22.  
  23.         Version 3.8i
  24.         April 27, 1987
  25.  
  26.         (C)opyright 1987 by Daniel M. Lawrence
  27.         Reference Manual (C)opyright 1987
  28.             by Brian Straight and Daniel M. Lawrence
  29.         All Rights Reserved
  30.  
  31.         MicroEMACS 3.8i can be copied and distributed freely
  32.         for any non-commercial purposes. MicroEMACS 3.8i can
  33.         only be incorporated into commercial software with
  34.         the permission of the current author.
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. Introduction
  73.  
  74.     MicroEMACS  is    a  tool  for  creating    and  changing documents,
  75. programs, and other  text  files.    It  is both relatively easy for the
  76. novice to use, but also  very  powerfull  in  the  hands  of  an expert.
  77. MicroEMACS can be extensively customized for the needs of the individual
  78. user.
  79.  
  80.     MicroEMACS allows several files to be edited at  the  same time.
  81. The  screen  can  be split into different windows, and text may be moved
  82. freely from one window to the next.  Depending on the type of file being
  83. edited, MicroEMACS can change  how  it    behaves  to make editing simple.
  84. Editing standard text files, program files and    wordprocessing documents
  85. are all possible at the same time.
  86.  
  87.     There are extensive capabilities  to  make  word  processing and
  88. editing  easier.    These  include  commands  for  string searching  and
  89. replacing, paragraph reformatting and deleting, automatic word wrapping,
  90. word move and deletes, easy case controling, and automatic word counts.
  91.  
  92.     For complex  and repetitive editing tasks editing macroes can be
  93. written.  These macroes allow the user a great degree of  flexibility in
  94. determining how MicroEMACS behaves.    Also any and all the commands can
  95. be used by  any  keystroke  by    changing,  or  rebinding,  what commands
  96. various keys are connected, or bound, to.
  97.  
  98.     Special features are also available  to perform a diverse set of
  99. operations such as file encryption,  automatic    backup    file generation,
  100. entabbing and detabbing  lines,  executing of DOS commands and filtering
  101. of text through other programs (like SORT to allow sorting text).
  102.  
  103. History
  104.  
  105.     EMACS was originally  a  text editor written by Richard Stahlman
  106. at  MIT  in  the  early  1970s for Digital Equipment computers.  Various
  107. versions, rewrites and clones have made an appearence since.
  108.  
  109.     This version of MicroEMACS is  derived from code written by Dave
  110. G.  Conroy in 1985.  Later modifications were performed by Steve Wilhite
  111. and George Jones.  In December of 1985    Daniel    Lawrence  picked  up the
  112. then current source  (version  2.0) and has made extensive modifications
  113. and additions to  it over the course of the next two years.  Updates and
  114. support for  the  current  version  is    still  in progress.  The current
  115. program author can be contacted by writing to:
  116.  
  117.     USMAIL: Daniel Lawrence
  118.         617 New York St
  119.         Lafayette, IN 47901
  120.  
  121.     UUCP:    ihnp4!pur-ee!pur-phy!duncan!lawrence
  122.     ARPA:    nwd@j.cc.purdue.edu
  123.     FIDO:    Fido 201/2 The Programmer's Room (317) 742-5533
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. MicroEMACS Reference Manual                  Basic Concepts
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.                    Chapter 1
  146.  
  147.                  Basic Concepts
  148.  
  149.  
  150.     The current version of MicroEMACS is 3.8i (Third major re-write,
  151. eighth public release, Ith  (or  ninth) minor release), and for the rest
  152. of this document, we shall simply refer to this version as "EMACS".  Any
  153. modifications for later versions will be listed in the appendixes at the
  154. end of this manual.
  155.  
  156.  
  157. 1.1  Keys and the Keyboard
  158.  
  159.  
  160.     Many  times  throught  this  manual  we  will  be talking  about
  161. commands  and  the keys on the keyboard needed use them.   There  are  a
  162. number of "special" keys which can be used and are listed here:
  163.  
  164. <NL>         NewLine which    is also called RETURN or ENTER, this key
  165.          is used to end different commands.
  166.  
  167. ^         The control  key  can    be  used  before  any alphabetic
  168.          character and some  symbols.    For example, ^C means to
  169.          hold down the <CONTROL>  key  and type the C key at the
  170.          same time.
  171.  
  172. ^X         The  CONTROL-X key is used at    the  beginning    of  many
  173.          different commands.
  174.  
  175. META or M-     This is a special EMACS key used to begin many commands
  176.          as well.  This key is pressed, and then released before
  177.          typing the next character.    On  most systems, this is
  178.          the  <ESC>  key,  but    it  can  be  changed.    (consult
  179.          appendix D to learn  what  key is used for META on your
  180.          computer).
  181.  
  182.     Whenever a command is described, the manual will list the actual
  183. keystokes needed to execute it    in boldface using the above conventions,
  184. and also the name of the command in italics.
  185.  
  186.  
  187. 1.2  Getting Started
  188.  
  189.  
  190.     In order to use EMACS, you must call it up from your system's or
  191. computer's command prompt.    On  UNIX    and  MSDOS  machines,  just type
  192. "emacs" from the main command prompt and follow it with the  <RETURN> or
  193.  
  194.  
  195.                                        1
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. Basic Concepts                     MicroEMACS Reference Manual
  203.  
  204.  
  205. <ENTER> key (we will refer to  this  key  as <NL> for "new-line" for the
  206. remainder  of  this  manual).  On the Macintosh, the Amiga, the ATARI ST
  207. and other icon based operating systems, double click on the uEMACS icon.
  208. Shortly after this, a screen similar to the one below should appear.
  209.  
  210.  
  211. 1.3  Parts and Pieces
  212.  
  213.  
  214.     The screen is divided into a number of    areas  or  windows.   On
  215. some systems the top window contains a function list  of  unshifted  and
  216. shifted function keys.    We will discuss these keys later. Below  them is
  217. an EMACS  mode    line  which,  as we will see, informs you of the present
  218. mode of operation of  the  editor--for example "(WRAP)" if you set EMACS
  219. to wrap at the end  of each line. Under the mode line is the text window
  220. where  text  appears  and is manipulated.  Since each window has its own
  221. mode line, below the text window is it's mode line.   The  last  line of
  222. the screen is the command line where EMACS takes commands and reports on
  223. what it is doing.
  224.  
  225. ===============================================================================
  226. f1 search      f2 search back : F1 toggle function list F2 toggle help file
  227. f3 hunt        f4 hunt back   : F3 find command/apropos F4 describe key
  228. f5 next window f6 exec macro  : F5 reformat paragraph    F6 ref undented region
  229. f7 find file   f8 exec file   : F7 indent region    F8 undent region
  230. f9 save file  f10 exit emacs  : F9 execute DOS command F10 shell up
  231. ===============================================================================
  232. -- MicroEMACS 3.8i () -- Function Keys ---------------------------------------
  233. ===============================================================================
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246. ===============================================================================
  247. -- MicroEMACS 3.8i () -- Main ------------------------------------------------
  248. ===============================================================================
  249.         Fig 1:    EMACS screen on an IBM-PC
  250.  
  251.  
  252. 1.4  Entering Text
  253.  
  254.  
  255.     Entering text in EMACS is simple.  Type  the  following sentence
  256. fragment:
  257.  
  258.       Fang Rock lighthouse, center of a series of mysterious and
  259.  
  260.  
  261. 2
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. MicroEMACS Reference Manual                  Basic Concepts
  269.  
  270.  
  271. The text is displayed at the top of the text window.  Now type:
  272.  
  273.       terrifying events at the turn of the century
  274.  
  275.     Notice the text to the left  of  the cursor disappears and a '$'
  276. sign appears.  Don't panic--your  text is safe!!! You've just discovered
  277. that  EMACS  doesn't  "wrap"  text  to    the  next  line  like most  word
  278. processors unless you hit <NL>.  But since EMACS is  used  for both word
  279. processing, and text editing, it has a bit of a  dual  personality.  You
  280. can change the way it works by setting various modes.  In this case, you
  281. need  to set WRAP mode, using the add-mode command, by typing ^X-M.  The
  282. command line at  the base of the screen will prompt you for the mode you
  283. wish  to  add.     Type wrap followed by the <NL> key and any text you now
  284. enter will be wrapped.      However, the command doesn't wrap text already
  285. entered.  To get rid of  the  truncated line, delete characters with the
  286. <BACKSPACE>  key  until the '$' goes away.  Now type in  the  words  you
  287. deleted, watch how EMACS goes down to the next line  at  the right time.
  288. (In some  versions  of    EMACS,    WRAP is a default mode in which case you
  289. don't  have  to  worry    about  the instructions relating to adding  this
  290. mode.)
  291.  
  292.     Now let's type a longer insert.  Hit <NL> a  couple  of times to
  293. tab  down  from  the  text  you  just  entered.  Now type the  following
  294. paragraphs.  Press <NL> twice to indicate a paragraph break.
  295.  
  296.       Fang Rock lighthouse,  center  of a series of mysterious and
  297.       terrifying events at the turn of the century, is built  on a
  298.       rocky island a few miles of the Channel coast.  So  small is
  299.       the  island  that  wherever you stand its rocks are wet with
  300.       sea spray.
  301.  
  302.       The  lighthouse tower is in the center of  the  island.     A
  303.       steep flight of steps  leads  to the heavy door in its base.
  304.       Winding stairs lead up to the crew room.
  305.  
  306.  
  307. 1.5  Basic cursor movement
  308.  
  309.  
  310.     Now  let's practice moving around in this text.    To  move  the
  311. cursor back to    the  word  "Winding,"  enter  M-B  previous-word.   This
  312. command moves the cursor backwards by one word at a time.  Note you have
  313. to press the key combination every time the  cursor  steps  back  by one
  314. word.     Continuously  pressing  META  and toggling B produces an  error
  315. message.    To    move forward to the word "stairs" enter M-F, which moves
  316. the cursor forward by one word at a time.
  317.  
  318.     Notice that EMACS commands are usually mnemonic--F  for forward,
  319. B for backward, for example.
  320.  
  321.     To move the cursor up one line, enter ^P previous-line, down one
  322. line ^N next-line.  Practice this  movement  by moving the cursor to the
  323. word "terrifying" in the second line.
  324.  
  325.  
  326.  
  327.                                        3
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. Basic Concepts                     MicroEMACS Reference Manual
  335.  
  336.  
  337.     The  cursor may also be moved forward  or  backward  in  smaller
  338. increments.    To  move forward by  one  character,  enter  ^F    forward-
  339. character, to move  backward,  ^B backward-character.  EMACS also allows
  340. you  to  specify a number which is normally used to tell  a  command  to
  341. execute  many  times.    To repeat most commands, press META and then the
  342. number before you enter the  command.     Thus,    the  command  META  5 ^F
  343. (M-5^F) will move  the    cursor    forward  by five characters.  Try moving
  344. around in the text by using these commands.  For extra practice, see how
  345. close  you can come to the word "small" in the first paragraph by giving
  346. an argument to the commands listed here.
  347.  
  348.     Two other simple cursor commands that are useful to help us move
  349. around in the text are M-N next-paragraph which moves the cursor  to the
  350. second paragraph, and M-P previous-paragraph  which moves it back to the
  351. previous paragraph.  The cursor may  also  be moved rapidly from one end
  352. of  the line to the other.  Move the cursor to the  word  "few"  in  the
  353. second line.  Press ^A beginning-of-line.  Notice the  cursor  moves  to
  354. the word "events" at the beginning of the line.  Pressing ^E end-of-line
  355. moves the cursor to the end of the line.
  356.  
  357.     Finally, the cursor may be moved  from    any point in the file to
  358. the  end  or  beginning of the file.  Entering M-> end-of-file moves the
  359. cursor    to the end of the buffer, M-<  beginning-of-file  to  the  first
  360. character of the file.
  361.  
  362.     On the IBM-PC, the ATARI ST and many other machines,  the cursor
  363. keys can also  be  used to move the cursor about.  Also, if there is one
  364. available, moving the mouse will move the cursor.
  365.  
  366.     Practice moving the cursor in the text until you are comfortable
  367. with the commands we've explored in this chapter.
  368.  
  369.  
  370. 1.6  Saving your text
  371.  
  372.  
  373.     When you've finished practicing cursor movement, save your file.
  374. Your file currently  resides  in  a  BUFFER.   The buffer is a temporary
  375. storage area for your text, and is lost when the computer is turned off.
  376. You can save the buffer to a file by entering  ^X-^S  save-file.  Notice
  377. that  EMACS informs you that your file has no name and will not let  you
  378. save it.
  379.  
  380.     To  save  your    buffer to a file with a different name than it's
  381. current one (which is empty), press ^X^W write-file.  EMACS  will prompt
  382. you for  the  filename    you  wish to write.  Enter the name fang.txt and
  383. press return.    On a micro, the drive light will come on, and EMACS will
  384. inform you it is writing the file.  When it finishes, it will inform you
  385. of the number of lines it has written to the disk.
  386.  
  387.     Congratulations!! You've just saved your first EMACS file!
  388.  
  389.  
  390.  
  391.  
  392.  
  393. 4
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. MicroEMACS Reference Manual                  Basic Concepts
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.                Chapter 1 Summary
  408.  
  409.  
  410.     In chapter 1, you learned how to enter    text,  how  to    use wrap
  411. mode, how to move the  cursor, and to save a buffer.  The following is a
  412. table  of  the    commands covered in this chapter and their corresponding
  413. key bindings:
  414.  
  415. Key Binding        Keystroke    Effect
  416.  
  417. abort-command        ^G        aborts current command
  418.  
  419. add-mode        ^XM        allows addition of EMACS
  420.                     mode such as WRAP
  421.  
  422. backward-character    ^B        moves cursor left one character
  423.  
  424. beginning-of-file    M-<        moves cursor to beginning of file
  425.  
  426. beginning-of-line    ^A        moves cursor to beginning of line
  427.  
  428. end-of-file        M->        moves cursor to end of file
  429.  
  430. end-of-line        ^E        moves cursor to end of line
  431.  
  432. forward-character    ^F        moves cursor right one character
  433.  
  434. next-line        ^N        moves cursor to next line
  435.  
  436. next-paragraph        M-N        moves cursor to next paragraph
  437.  
  438. next-word        M-F        moves cursor forward one word
  439.  
  440. previous-line        ^P        moves cursor backward by one line
  441.  
  442. previous-paragraph    M-P        moves cursor to previous paragraph
  443.  
  444. previous-word        M-B        moves cursor backward by one word
  445.  
  446. save-file        ^X-^S        saves current buffer to a file
  447.  
  448. write-file        ^X-^W        save current buffer under a new name
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                        5
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. Basic Editing--Simple Insertions and Deletions        MicroEMACS Reference
  467.                                   Manual
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.                    Chapter 2
  477.  
  478.          Basic Editing--Simple Insertions and Deletions
  479.  
  480.  
  481. 2.1  A Word About Windows, Buffers, Screens, and Modes
  482.  
  483.  
  484.     In the first chapter, you learned how to create and save  a file
  485. in EMACS. Let's do some more editing on  this  file.    Call up emacs by
  486. typing in the following command.
  487.  
  488.     emacs fang.txt
  489.  
  490.     On  icon  oriented  systems, double click on  the  uEMACS  icon,
  491. usually a file dialog box of some sort    will  appear.     Choose FANG.TXT
  492. from the appropriate folder.
  493.  
  494.     Shortly  after    you  invoke EMACS, the text should appear on the
  495. screen ready  for  you    to  edit.  The text you are looking at currently
  496. resides in a buffer.  A  buffer  is  a temporary area of computer memory
  497. which is the primary unit internal to EMACS -- this  is  the place where
  498. EMACS goes to work.  The mode line at the bottom of the screen lists the
  499. buffer name, FANG.TXT and the name of the file with which this buffer is
  500. associated, FANG.TXT
  501.  
  502.     The computer talks to you through  the    use of its screen.  This
  503. screen usually has an area of 24 lines    each  of  80  characters across.
  504. You can use  EMACS  to    subdivide  the screen into several separate work
  505. areas, or windows, each  of  which can be 'looking into' different files
  506. or sections of text.  Using windows, you  can  work  on  several related
  507. texts at one  time,  copying  and  moving blocks of text between windows
  508. with ease.   To  keep  track  of  what    you  are editing, each window is
  509. identified by a mode line on the last line of the window which lists the
  510. name of  the  buffer  which  it is looking into, the file from which the
  511. text was read, and how the text is being edited.
  512.  
  513.     An EMACS mode tells EMACS how  to  deal  with user input.  As we
  514. have already seen, the mode 'WRAP' controls how EMACS  deals  with  long
  515. lines (lines with over 79 characters) while the user is typing    them in.
  516. The  'VIEW' mode, allows you to read a file without modifying it.  Modes
  517. are associated with buffers and not  with  files; hence, a mode needs to
  518. be explicitly set or removed every time you  edit  a  file.   A new file
  519. read into a buffer with a previously specified mode will be edited under
  520. this  mode.    If you use specific modes frequently, EMACS allows you to
  521. set the modes which are used by all new buffers, called global modes.
  522.  
  523.  
  524.  
  525. 6
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. MicroEMACS Reference Manual        Basic Editing--Simple Insertions and
  533.                                    Deletions
  534.  
  535.  
  536. 2.2  Insertions
  537.  
  538.  
  539.     Your previously-saved text should look like this:
  540.  
  541.       Fang Rock lighthouse,  center  of a series of mysterious and
  542.       terrifying events at the turn of the century, is built  on a
  543.       rocky island a few miles of the Channel coast.  So  small is
  544.       the  island  that  wherever you stand its rocks are wet with
  545.       sea spray.
  546.  
  547.       The  lighthouse tower is in the center of  the  island.     A
  548.       steep flight of steps  leads  to the heavy door in its base.
  549.       Winding stairs lead up to the crew room.
  550.  
  551.     Let's assume you want to add a sentence in the    second paragraph
  552. after  the  word  "base."    Move the cursor until it is on the  "W"  of
  553. "Winding". Now type the following:
  554.  
  555.       This  gives entry to the lower floor  where  the    big  steam
  556.       generator  throbs  steadily away, providing  power  for  the
  557.       electric lantern.
  558.  
  559.     If the line fails to  wrap and you end up with a '$' sign in the
  560. right margin, just  enter  M-Q fill-paragraph to reformat the paragraph.
  561. This  new  command  attempts to fill out a paragraph.    Long  lines  are
  562. divided up, and  words    are  shuffled  around to make the paragraph look
  563. nicer.
  564.  
  565.     Notice that all visible EMACS characters  are  self-inserting --
  566. all you had to do was  type  the  characters to insert and the exisiting
  567. text made space for it.  With a few exceptions discussed later, all non-
  568. printing characters  (such as control or escape sequences) are commands.
  569. To insert spaces,  simply use the space bar.  Now move to the first line
  570. of the file and type ^O open-line (Oh, not zero).    You've just learned
  571. how to insert a blank line in your text.
  572.  
  573.  
  574. 2.3  Deletions
  575.  
  576.  
  577.     EMACS  offers  a  number of deletion options.  For example, move
  578. the cursor until it's under the period at the end  of  the insertion you
  579. just  did.    Press  the  backspace  key.   Notice the "n" on  "lantern"
  580. disappeared.  The backspace implemented on EMACS is called a destructive
  581. backspace--it  removes    text   immediately  before  the  current  cursor
  582. position  from    the  buffer.    Now  type  ^H delete-previous-character.
  583. Notice    that  the  cursor  moves  back and obliterates    the  "r"--either
  584. command will backspace the cursor.
  585.  
  586.     Type in the two letters you erased to restore your text and move
  587. the cursor to the obeginning of the buffer M-> beginning-of-file.   Move
  588. the cursor down one line to the beginning of the first paragraph.
  589.  
  590.  
  591.                                        7
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598. Basic Editing--Simple Insertions and Deletions        MicroEMACS Reference
  599.                                   Manual
  600.  
  601.  
  602.     To delete the  forward character, type ^D delete-next-character.
  603. The  "F" of "Fang" disappears.    Continue to type ^D until the whole word
  604. is erased EMACS also permits the deletion of larger  elements  of  text.
  605. Move  the  cursor  to the word "center"  in  the  first  line  of  text.
  606. Pressing  M-<backspace> delete-previous-word kills the word  immediately
  607. before the cursor.  M-^H has the same effect.
  608.  
  609.     Notice    that  the  commands  are  very    similar  to the  control
  610. commands  you  used  to delete individual letters.  As a general rule in
  611. EMACS,    control sequences affect small areas  of  text,  META  sequences
  612. larger areas.  The word forward of the cursor position can  therefore be
  613. deleted  by  typing  M-D  delete-next-word.    Now  let's take    out  the
  614. remainder of the first    line  by typing ^K kill-to-end-of-line.  You now
  615. have a blank  line  at the top of your screen.    Typing ^K again or ^X-^O
  616. delete-blank-lines deletes the blank line and flushes the second line to
  617. the top of the text.  Now exit EMACS by typing ^X-^C exit-emacs.  Notice
  618. EMACS  reminds    you  that you have not saved your buffer.    Ignore  the
  619. warning and exit.  This way you can exit EMACS without saving any of the
  620. changes you just made.
  621.  
  622.  
  623.  
  624.  
  625.                Chapter 2 Summary
  626.  
  627.  
  628.     In Chapter 2, you learned about the basic  'building  blocks' of
  629. an EMACS text file--buffers, windows, and files.
  630.  
  631. Key binding        Keystroke    Effect
  632. delete-previous-character
  633.             ^H        deletes character immediately before
  634.                     the current cursor position
  635.  
  636. delete-next-character    ^D        deletes character immediately after
  637.                     current cursor position
  638.  
  639. delete-previous-word    M-^H        deletes word immediately before
  640.                     current cursor position
  641.  
  642. delete-next-word    M-D        deletes word immediately after
  643.                     current cursor position
  644.  
  645. kill-to-end-of-line    ^K        deletes from current cursor
  646.                     position to end of line
  647.  
  648. insert-space        ^C        inserts a space to right of cursor
  649.  
  650. open-line        ^O        inserts blank line
  651.  
  652. delete-blank-lines    ^X-^O        removes blank line
  653.  
  654. exit-emacs        ^X-^C        exits emacs
  655.  
  656.  
  657. 8
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664. MicroEMACS Reference Manual                   Using Regions
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.                    Chapter 3
  674.  
  675.                  Using Regions
  676.  
  677.  
  678. 3.1  Defining and Deleting a Region
  679.  
  680.  
  681.     At  this  point  its time to familiarize ourselves with two more
  682. EMACS  terms--the point and the mark.  The  point  is  located    directly
  683. behind the current cursor position.  The mark (as we shall  see shortly)
  684. is user defined.    These  two    elements together are called the current
  685. region    and limit the region of text on which EMACS performs many of its
  686. editing functions.
  687.  
  688.     Let's begin by entering some new text.    Don't forget to add wrap
  689. mode if its not set  on this buffer.  Start EMACS and open a file called
  690. PUBLISH.TXT.  Type in the following text:
  691.  
  692.       One of the largest growth  areas    in  personal  computing is
  693.       electronic  publishing.     There    are packages available for
  694.       practically every machine from elegantly simple programs for
  695.       the  humble  Commodore  64  to   sophisticated  professional
  696.       packages for PC and Macintosh computers.
  697.  
  698.       Electronic publishing  is as revolutionary in its way as the
  699.       Gutenburg press.    Whereas  the  printing    press  allowed the
  700.       mass  production    and  distribution  of  the  written  word,
  701.       electronic publishing puts the means  of    production  in the
  702.       hands of nearly  every  individual.  From the class magazine
  703.       to  the corporate report, electronic publishing is  changing
  704.       the way we produce and disseminate information.
  705.  
  706.       Personal     publishing  greatly  increases  the  utility    of
  707.       practically every computer.  Thousands of people    who joined
  708.       the computer revolution of  this    decade    only to hide their
  709.       machines unused in closets have  discovered  a  new  use for
  710.       them as dedicated publishing workstations.
  711.  
  712.     Now let's do some editing.  The last paragraph    seems  a  little
  713. out of place.  To see what the document looks like without it we can cut
  714. it from the text by moving the cursor to the beginning of the paragraph.
  715. Enter M-<space> set-mark.  EMACS will respond with "[Mark  set]".    Now
  716. move the cursor to the end of the paragraph.  You  have  just  defined a
  717. region    of  text.  To remove this text from the screen,  type  ^W  kill-
  718. region.  The paragraph disappears from the screen.
  719.  
  720.  
  721.  
  722.  
  723.                                        9
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. Using Regions                     MicroEMACS Reference Manual
  731.  
  732.  
  733.     On further consideration, however, perhaps the paragraph  we cut
  734. wasn't so bad after all.   The    problem  may have been one of placement.
  735. If we could  tack  it on to the end of the first paragraph it might work
  736. quite well to support and strengthen  the  argument.  Move the cursor to
  737. the end of  the first paragraph and enter ^Y yank.  Your text should now
  738. look like this:
  739.  
  740.       One of the largest growth  areas    in  personal  computing is
  741.       electronic  publishing.     There    are packages available for
  742.       practically every machine from elegantly simple programs for
  743.       the  humble  Commodore  64  to   sophisticated  professional
  744.       packages    for  PC  and   Macintosh   computers.      Personal
  745.       publishing  greatly increases  the  utility  of  practically
  746.       every computer.  Thousands of people who joined the computer
  747.       revolution of this decade only to hide their machines unused
  748.       in closets have discovered a new use for    them  as dedicated
  749.       publishing workstations.
  750.  
  751.       Electronic publishing  is as revolutionary in its way as the
  752.       Gutenburg press.    Whereas  the  printing    press  allowed the
  753.       mass  production    and  distribution  of  the  written  word,
  754.       electronic publishing puts the means  of    production  in the
  755.       hands of nearly every individual. From the class magazine to
  756.       the corporate report,  electronic publishing is changing the
  757.       way we produce and disseminate information.
  758.  
  759.  
  760. 3.2  Yanking a Region
  761.  
  762.  
  763.     The text you cut initially  didn't simply just disappear, it was
  764. cut  into  a  buffer that retains the 'killed' text appropriately called
  765. the kill  buffer.    ^Y  "yanks" the text back from this buffer into the
  766. current buffer. If you have a long line (indicated, remember, by the "$"
  767. sign), simply hit M-Q to reformat the paragraph.
  768.  
  769.     There are other uses to which the kill buffer can be put.  Using
  770. the method we've already learned, define the last paragraph as a region.
  771. Now type M-W copy-region.  Nothing seems to have  happened;  the  cursor
  772. stays blinking at the point.   But  things have changed, even though you
  773. may not be able to see any alteration.
  774.  
  775.     To see what  has  happened  to    the contents of the kill buffer,
  776. move the cursor down a couple  of  lines  and "yank" the contents of the
  777. kill  buffer  back  with ^Y.  Notice the last paragraph is now repeated.
  778. The region you defined is "tacked on" to the end of your file because M-
  779. W  copies a region to the kill buffer while leaving the original text in
  780. your working buffer.    Some  caution  is  needed  however,  because the
  781. contents of the  kill  buffer  are  updated when you delete any regions,
  782. lines  or  words.   If you are moving large quantities of text, complete
  783. the  operation    before    you do any more deletions or you could find that
  784. the text you want to move has been replaced by the most recent deletion.
  785. Remember--a buffer is a  temporary  area of computer memory that is lost
  786. when the machine is powered down or switched off.  In order to make your
  787.  
  788.  
  789. 10
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796. MicroEMACS Reference Manual                   Using Regions
  797.  
  798.  
  799. changes permanent, they must be saved to a file before you  leave EMACS.
  800. Let's  delete  the section of text we just added and save  the    file  to
  801. disk.
  802.  
  803.  
  804.  
  805.  
  806.                Chapter 3 Summary
  807.  
  808.  
  809.     In Chapter 3, you learned how to achieve  longer  insertions and
  810. deletions.   The  EMACS  terms    point  and  mark were introduced and you
  811. learned how to manipulate text with the kill buffer.
  812.  
  813. Key Binding    Keystroke    Effect
  814.  
  815. Delete-Region    ^W        Deletes region between point and mark and
  816.                 places it in KILL buffer
  817.  
  818. Copy-Region    M-W        Copies text between point and mark into
  819.                 KILL buffer
  820.  
  821. Yank-Text    ^Y        Inserts a copy of the KILL buffer into
  822.                 current buffer at point
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.                                       11
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862. Search and Replace                 MicroEMACS Reference Manual
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.                    Chapter 4
  872.  
  873.                Search and Replace
  874.  
  875.  
  876. 4.1  Forward Search
  877.  
  878.  
  879.     Load EMACS and    bring  in  the    file  you just saved.  Your file
  880. should look like the one below.
  881.  
  882.       One of the largest growth  areas    in  personal  computing is
  883.       electronic  publishing.     There    are packages available for
  884.       practically every machine from elegantly simple programs for
  885.       the  humble  Commodore  64  to   sophisticated  professional
  886.       packages    for  PC  and   Macintosh   computers.      Personal
  887.       publishing  greatly increases  the  utility  of  practically
  888.       every computer.  Thousands of people who joined the computer
  889.       revolution of this decade only to hide their machines unused
  890.       in closets have discovered a new use for    them  as dedicated
  891.       publishing workstations.
  892.  
  893.       Electronic publishing  is as revolutionary in its way as the
  894.       Gutenburg press.    Whereas  the  printing    press  allowed the
  895.       mass  production    and  distribution  of  the  written  word,
  896.       electronic publishing puts the means  of    production  in the
  897.       hands of nearly every individual. From the class magazine to
  898.       the corporate report,  electronic publishing is changing the
  899.       way we produce and disseminate information.
  900.  
  901.     Let's  use  EMACS  to search for the word "revolutionary" in the
  902. second    paragraph.    Because  EMACS  searches from the  current  cursor
  903. position toward the  end  of  buffers,    and we intend to search forward,
  904. move the cursor to the beginning of the text.  Enter  ^S search-forward.
  905. Note that the command line now reads
  906.  
  907.     "Search [] <META>:"
  908.  
  909.     EMACS is prompting you to enter the search string  --  the  text
  910. you want to find.  Enter  the  word  revolutionary and hit the META key.
  911. The cursor moves to the end of the word "revolutionary."
  912.  
  913.     Notice that you must  enter  the <META> key to start the search.
  914. If  you  simply  press    <NL>  the  command  line responds  with  "<NL>".
  915. Although this may seem infuriating to users who are used to pressing the
  916. return    key  to  execute  any  command,  EMACS'  use  of <META> to begin
  917. searches allows it to pinpoint text with great accuracy.    After  every
  918. line wrap or carriage return, EMACS 'sees' a new line  character (<NL>).
  919.  
  920.  
  921. 12
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928. MicroEMACS Reference Manual                  Search and Replace
  929.  
  930.  
  931. If you need to search for a word at the end of a line,    you  can specify
  932. this word uniquely in EMACS.
  933.  
  934.     In our sample text  for  example, the word "and" occurs a number
  935. of times, but only once at the end  of    a  line.    To    search    for this
  936. particular occurance of the word, move the cursor to  the  beginning  of
  937. the buffer and type ^S.  Notice that  EMACS  stores  the  last specified
  938. search string as the default string.  If  you  press  <META>  now, EMACS
  939. will search for the default string, in this case, "revolutionary."
  940.  
  941.     To change this string  so  we can search for our specified "and"
  942. simply enter the word and followed by <NL>.  The command line now shows:
  943.  
  944.     "search [and<NL>]<META>:"
  945.  
  946.     Press <META> and the cursor moves to "and"  at    the  end  of the
  947. second last line.
  948.  
  949.  
  950. 4.2  Exact Searches
  951.  
  952.  
  953.     If  the  mode  EXACT is active    in  the  current  buffer,  EMACS
  954. searches on a case sensitive basis.  Thus, for example you  could search
  955. for Publishing as distinct from publishing.
  956.  
  957.  
  958. 4.3  Backward Search
  959.  
  960.  
  961.     Backward searching is very similar to  forward    searching except
  962. that it is implemented in the reverse direction.  To implement a reverse
  963. search,  type ^R search-reverse.  Because  EMACS  makes  no  distinction
  964. between forward and backward stored search strings, the last search item
  965. you entered appears as the default  string.   Try searching back for any
  966. word that  lies  between  the  cursor  and  the beginning of the buffer.
  967. Notice    that when the item is found, the point moves to the beginning of
  968. the found string (i.e., the cursor appears under the first letter of the
  969. search item).
  970.  
  971.     Practice searching for other words in your text.
  972.  
  973.  
  974. 4.4  Searching and Replacing
  975.  
  976.  
  977.     Searching  and    replacing  is a powerful and quick way of making
  978. changes to your text.     Our sample text is about electronic publishing,
  979. but the correct  term  is  'desktop'  publishing.  To make the necessary
  980. changes we need to replace all occurances of the word  "electronic" with
  981. "desktop." First, move the cursor to the top of the current  buffer with
  982. the  M-<  command.  Then type M-R  replace-string.    The  command  line
  983. responds:
  984.  
  985.  
  986.  
  987.                                       13
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994. Search and Replace                 MicroEMACS Reference Manual
  995.  
  996.  
  997.     "Replace []<META>:"
  998.  
  999.     where the square brackets enclose  the default string.    Type the
  1000. word electronic and hit <META>.  The command line responds:
  1001.  
  1002.     "with []<META>"
  1003.  
  1004.     type  desktop<META>.    EMACS  replaces  all  instances  of  the
  1005. original  word    with  your  revision.     Of  course,  you  will have  to
  1006. captialize  the  first    letter    of  "desktop"  where  it occurs  at  the
  1007. beginning of a sentence.
  1008.  
  1009.     You  have  just  completed an unconditional replace.    In  this
  1010. operation,  EMACS  replaces  every instance of the found string with the
  1011. replacement string.
  1012.  
  1013.  
  1014. 4.5  Query-Replace
  1015.  
  1016.  
  1017.     You may  also  replace    text  on a case by case basis.    The M-^R
  1018. query-replace-string command causes  EMACS  to pause at each instance of
  1019. the found string.
  1020.  
  1021.     For example, assume we    want  to  replace  some instances of the
  1022. word "desktop" with the word "personal." Go back to the beginning of the
  1023. current buffer and enter the  M-^R query-replace command.  The procedure
  1024. is  very  similar  to  that  which  you  followed in  the  unconditional
  1025. search/replace option.    When the  search begins however, you will notice
  1026. that EMACS pauses at each instance of "publishing" and asks  whether you
  1027. wish to replace it with the  replacement  string.   You have a number of
  1028. options available for response:
  1029.  
  1030.     Response    Effect
  1031.     Y(es)    Make the current replacement and skip to the next
  1032.         occurance of the search string
  1033.  
  1034.     N(o)    Do not make this replacement but continue
  1035.  
  1036.     !    Do the rest of the replacements with no more queries
  1037.  
  1038.     U(ndo)    Undo just the last replacement and query for it
  1039.         again (This can only go back ONE time)
  1040.  
  1041.     ^G    Abort the replacement command (This action does not
  1042.         undo previously-authorized replacements
  1043.  
  1044.     .    Same effect as ^G, but cursor returns to the point at
  1045.         which the replacement command was given
  1046.  
  1047.     ?    This lists help for the query replacement command
  1048.  
  1049.     Practice searching and searching and  replacing  until    you feel
  1050. comfortable with the commands and their effects.
  1051.  
  1052.  
  1053. 14
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. Windows                                      MicroEMACS Reference Manual
  1061.  
  1062.  
  1063.                Chapter 4 Summary
  1064.  
  1065.  
  1066.     In this chapter, you learned how to search for specified strings
  1067. of  text  in  EMACS.    The  chapter  also dealt with searching for  and
  1068. replacing elements within a buffer.
  1069.  
  1070. Key Binding        Keystroke             Effect
  1071.  
  1072. Search-Forward        ^S    Searches from point to end of buffer.
  1073.                 Point is moved from current location to
  1074.                 the end of the found string
  1075.  
  1076. Search-Backward         ^R    Searches from point to beginning of buffer.
  1077.                 Point is moved from current location to
  1078.                 beginning of found string
  1079.  
  1080. Replace                 M-R Replace ALL ocurrences of search string with
  1081.                 specified (null) string from point to the
  1082.                 end of the current buffer
  1083.  
  1084. Query-Replace           M-^R    As above, but pause at each found string
  1085.                 and query for action
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119. 16
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. MicroEMACS Reference Manual                     Windows
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.                    Chapter 5
  1136.  
  1137.                 Windows
  1138.  
  1139.  
  1140. 5.1  Creating Windows
  1141.  
  1142.  
  1143.     We  have already met windows in an earlier  chapter.    In  this
  1144. chapter, we will explore one of EMACS' more powerful  features    --  text
  1145. manipulation through multiple windowing.
  1146.  
  1147.     You will recall that  windows  are areas of buffer text that you
  1148. can see on the screen.    Because EMACS can support several screen windows
  1149. simultaneously you can    use  them  to  look into different places in the
  1150. same  buffer.     You  can  also  use them to look at text  in  different
  1151. buffers.  In effect, you can edit several files at the same time.
  1152.  
  1153.     Let's invoke EMACS and pull  back our file on desktop publishing
  1154. by typing
  1155.  
  1156.       emacs publish.txt
  1157.  
  1158.     When  the  text  appears,  type  the  ^X-2  split-current-window
  1159. command.  The  window  splits  into  two  windows.  The window where the
  1160. cursor resides is called the current  window  -- in this case the bottom
  1161. window.  Notice  that  each window has a text area and a mode line.  The
  1162. command line is however, common to all windows on the screen.
  1163.  
  1164.     The  two  windows  on your screen are virtually mirror images of
  1165. each  other because the new window is opened into the same buffer as the
  1166. one you are in when you issue the  Open-Window    command.    All commands
  1167. issued    to  EMACS are executed on the  current    buffer    in  the  current
  1168. window.
  1169.  
  1170.     To move  the  cursor  to  the  upper  window (i.e., to make that
  1171. window the current window, type ^X-P previous-window.  Notice the cursor
  1172. moves to the upper or previous window.    Entering ^X-O  next-window moves
  1173. to the next window.  Practice  moving  between windows.  You will notice
  1174. that you can  also  move  into    the  Function Key menu by entering these
  1175. commands.
  1176.  
  1177.     Now move to the upper window.  Let's open a new  file.      On the
  1178. EMACS  disk is a tutorial file.  Let's call it into the upper window  by
  1179. typing:
  1180.  
  1181.       ^X-^F find-file
  1182.  
  1183.  
  1184.  
  1185.                                       17
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. Windows                                      MicroEMACS Reference Manual
  1193.  
  1194.  
  1195. and press return.  Then enter the filename emacs.tut.
  1196.  
  1197.     In a short time, the tutorial file will appear    in  the  window.
  1198. We now    have  two  windows  on    the  screen, each looking into different
  1199. buffers.  We  have just used the ^X- ^F find-file command to find a file
  1200. and bring it into our current window.
  1201.  
  1202.     You can scroll any window up  and  down with the cursor keys, or
  1203. with the commands  we've  learned  so  far. However, because the area of
  1204. visible  text in each window is relatively small,  you    can  scroll  the
  1205. current window a line at a time.
  1206.  
  1207.     Type ^X-^N move-window-down
  1208.  
  1209.     The current window scrolls down by  one  line -- the top line of
  1210. text scrolls out of view, and the bottom line moves  towards  the top of
  1211. the  screen.    You can imagine, if you like, the  whole  window  slowly
  1212. moving down to the end of the buffer  in  increments  of  one line.  The
  1213. command  ^X-^P    move-window-up    scrolls  the  window  in   the    opposite
  1214. direction.
  1215.  
  1216.     As  we have seen, EMACS editing commands  are  executed  in  the
  1217. current  window,  but  the  program  does support a useful feature  that
  1218. allows you to scroll  the  next window.  M-^Z scroll-next-up scrolls the
  1219. next window up, M-^U  scroll-next-down    scrolls  it  downward.    From the
  1220. tutorial  window,  practice  scrolling    the  window  with   the  desktop
  1221. publishing text in it up and down.
  1222.  
  1223.     When you're finished,  exit  EMACS without saving any changes in
  1224. your files.
  1225.  
  1226.     Windows offer you  a  powerful    and  easy  way to edit text.  By
  1227. manipulating   a  number  of  windows  and   buffers   on   the   screen
  1228. simultaneously,  you can perform complete edits  and  revisions  on  the
  1229. computer screen while having your  draft text or original data available
  1230. for reference in another window.
  1231.  
  1232.     Experiment  with splitting the windows on  your  screen.    Open
  1233. windows into different buffers and experiment with any    other  files you
  1234. may have.   ry editing the text in each window, but don't forget to save
  1235. any changes you want to keep --  you  still  have  to  save  each buffer
  1236. separately.
  1237.  
  1238.  
  1239. 5.2  Deleting Windows
  1240.  
  1241.  
  1242. 5.3  Resizing Windows
  1243.  
  1244.  
  1245. 5.4  Other Window commands
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251. 18
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258. MicroEMACS Reference Manual                     Windows
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.                Chapter 5 Summary
  1266.  
  1267.  
  1268.     In  Chapter  5    you  learned  how to manipulate windows and  the
  1269. editing flexibility they offer.
  1270.  
  1271. Key Binding        Keystroke               Effect
  1272.  
  1273. Open-Window        ^X-2        Splits current window into two windows
  1274.                     if space is available
  1275.  
  1276. Close-Windows        ^X-1        Closes all windows except current
  1277.                     window
  1278.  
  1279. Next-Window        ^X-O        Moves point into next (i.e. downward)
  1280.                     window
  1281.  
  1282. Previous-Window         ^X-P        Moves point to previous (i.e. upward)
  1283.                     window
  1284.  
  1285. Move-Window-Down    ^X-^N        Scrolls current window down one line
  1286.  
  1287. Move-Window-Up        ^X-^P        Scrolls current window up one line
  1288.  
  1289. Redraw-display        M-! or        Window is moved so line with point
  1290.             M-^L        (with cursor) is at center of window
  1291.  
  1292. Grow-Window        ^X-^        Current window is enlarged by one
  1293.                     line and nearest window is shrunk by
  1294.                     one line
  1295.  
  1296. Shrink-Window        ^X-^Z        Current window is shrunk by one line
  1297.                     and nearest window is enlarged by one
  1298.                     line
  1299.  
  1300. Clear-and-Redraw    ^L        Screen is blanked and redrawn.    Keeps
  1301.                     screen updates in sync with your
  1302.                     commands
  1303.  
  1304. Scroll-Next-Up        M-^Z        Scrolls next window up by one line
  1305.  
  1306. Scroll-Next-Down    M-^U        Scrolls next window down by one line
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.                                       19
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. Buffers                                      MicroEMACS Reference Manual
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.                    Chapter 6
  1334.  
  1335.                 Buffers
  1336.  
  1337.  
  1338.      We have already learned a  number  of things about buffers.  As
  1339. you  will  recall,  they are the major internal entities in EMACS -- the
  1340. place  where  editing  commands are executed.  They are characterized by
  1341. their  names,  their  modes,  and  by  the  file  with    which  they  are
  1342. associated.   Each buffer also "remembers" its mark  and  point.    This
  1343. convenient feature allows you to go  to  other buffers and return to the
  1344. original location in the "current" buffer.
  1345.  
  1346.     Advanced users of EMACS frequently have a number  of  buffers in
  1347. the computer's memory simultaneously.  In the last chapter, for example,
  1348. you  opoened at least two buffers -- one into the text you were editing,
  1349. and the other into the EMACS on-line tutorial.    If you deal with complex
  1350. text files -- say, sectioned chapters  of  a  book, you may have five or
  1351. six buffers in    the  computer's  memory.    You  could    select different
  1352. buffers  by simply calling up the file with  ^X-^F  find-file,    and  let
  1353. EMACS  open  or  reopen  the  buffer.     However,  EMACS offers fast and
  1354. sophisticated buffering techniques that you will find easy to master and
  1355. much more convenient to use.
  1356.  
  1357.     Let's begin by opening three buffers.  You can    open  any  three
  1358. you choose, for example call  the following files into memory: fang.txt,
  1359. publish.txt, and emacs.tut  in    the  order  listed  here.    When you've
  1360. finished this process, you'll  be  looking at a screen showing the EMACS
  1361. tutorial.    Let's  assume that you want to move to the fang.txt buffer.
  1362. Enter:
  1363.  
  1364.     ^X-X next-buffer
  1365.  
  1366.     This command moves you to the next buffer.  Because EMACS cycles
  1367. through the buffer list, which is  alphabetized,  you will now be in the
  1368. fang.txt buffer. Using ^X-X again  places you in the publish.txt buffer.
  1369. If  you  are  on a machine that supports function keys, using ^X-X again
  1370. places you in the Function Keys buffer. Using ^X-X one last  time cycles
  1371. you back to the beginning of the list.
  1372.  
  1373.     If you have a large number of buffers to deal with, this cycling
  1374. process  may  be  slow and inconvenient.  The command ^X-B select-buffer
  1375. allows    you to specify the buffer you wish to be switched to.  When  the
  1376. command  is entered, EMACS prompts, "Use buffer:".    Simply  enter  the
  1377. buffer    name  (NOT  the file name), and that buffer will then become the
  1378. current buffer.
  1379.  
  1380.  
  1381.  
  1382.  
  1383. 20
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390. MicroEMACS Reference Manual                     Buffers
  1391.  
  1392.  
  1393.     Multiple buffer manipulation and editing is a  complex activity,
  1394. and you will probably  find  it very inconvenient to re-save each buffer
  1395. as you modify it.  The    command  ^X-^B list-buffers creates a new window
  1396. that  gives  details  about  all  the buffers currently known to  EMACS.
  1397. Buffers that have been modified are identified by  the    "buffer changed"
  1398. indicator (an asterisk in the second column).  You can thus  quickly and
  1399. easily identify buffers that need to  be  saved to files before you exit
  1400. EMACS.     The buffer window also provides  other  information  --  buffer
  1401. specific modes, buffer size, and buffer name are also listed.    To close
  1402. this window, simply type the close-windows command, ^X-1.
  1403.  
  1404.     To delete any buffer,  type  ^X-K  delete-buffer.  EMACS prompts
  1405. you "Kill buffer:".   Enter the buffer name you want to delete.  As this
  1406. is  destructive  command,  EMACS will ask for confirmation if the buffer
  1407. was  changed and not saved.  Answer Y(es) or N(o).  As usual ^G  cancels
  1408. the command.
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.                                       21
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456. Buffers                                      MicroEMACS Reference Manual
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.                Chapter 6 Summary
  1464.  
  1465.  
  1466.     In Chapter 6 you learned how to manipulate buffers.
  1467.  
  1468. Key Binding        Keystroke               Effect
  1469. Next-Buffer        ^X-^X        Switch to the next buffer in the
  1470.                     buffer list
  1471.  
  1472. Select-Buffer        ^X-B        Switch to a particular buffer
  1473.  
  1474. List-Buffers        ^X-^B        List all buffers
  1475.  
  1476. Delete-Buffer        ^X-K        delete a particular buffer if it
  1477.                     is off-screen
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515. 22
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522. MicroEMACS Reference Manual                       Modes
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.                    Chapter 7
  1532.  
  1533.                  Modes
  1534.  
  1535.  
  1536.     EMACS  allows  you  to change the  way    it  works  in  order  to
  1537. customized it to the style of editing you are using.   It  does  this by
  1538. providing a number of different modes.    These modes can effect    either a
  1539. single buffer, or any new  buffer that is created.  To add a mode to the
  1540. current buffer, type ^X-M add-mode.  EMACS will then prompt you  for the
  1541. name of a mode to add.    When you type  in  a legal mode name, and type a
  1542. <NL>, EMACS will  add the mode name to the list of current mode names in
  1543. the modeline of the current buffer.
  1544.  
  1545.     To remove an existing  mode,  typing  the ^X-^M delete-mode will
  1546. cause EMACS to prompt you  for    the  name  of  a mode to delete from the
  1547. current buffer.  This will remove  that  mode  from the mode list on the
  1548. current modeline.
  1549.  
  1550.     Global modes are  the  modes  which  are  inherited  by  any new
  1551. buffers which are created.  For example, if you wish to always do string
  1552. searching with character  case    being significant, you would want global
  1553. mode EXACT to be set so that any new files read  in  inherent  the EXACT
  1554. mode.  Global modes are set with the M-M  add-global-mode  command,  and
  1555. unset  with  the  M-^M delete-global-mode command.   Also,  the  current
  1556. global modes are  displayed  in  the  first line of a ^X-^B list-buffers
  1557. command.
  1558.  
  1559.     On machines which are capable  of  displaying  colors,    the mode
  1560. commands can also set the  background  and  forground  character colors.
  1561. Using add-mode or  delete-mode    with  a  lowercase  color  will  set the
  1562. background color in the current window.  An uppercase color will set the
  1563. forground color in the current window.    Colors that  EMACS  knows  about
  1564. are: white, cyan, magenta, yellow, blue, red, green, and black.   If the
  1565. computer you  are  running  on    does  not  have eight colors, EMACS will
  1566. attempt to make some intellegent guess at what color to use when you ask
  1567. for one which is not there.
  1568.  
  1569.  
  1570. 7.1  ASAVE mode
  1571.  
  1572.  
  1573.     Automatic Save mode  tells  EMACS to automatically write out the
  1574. current buffer to its associated file on a regular basis.  Normally this
  1575. will be  every    256  characters  typed    into  the file.  The environment
  1576. variable $ACOUNT counts down to the next auto-save, and  $ASAVE  is  the
  1577. value used to reset $ACOUNT after a save occurs.
  1578.  
  1579.  
  1580.  
  1581.                                       23
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588. Modes                         MicroEMACS Reference Manual
  1589.  
  1590.  
  1591. 7.2  CMODE mode
  1592.  
  1593.  
  1594.     CMODE is useful to  C  programmers.  When CMODE is active, EMACS
  1595. will try to assist the user in a number of  ways.    This  mode  is  set
  1596. automatically with files that have a .c or .h extension.
  1597.  
  1598.     The <NL> key  will  normally  attempt  to return the user to the
  1599. next line at the same level  of  indentation as the current line, unless
  1600. the  current line ends with a open brace ({) in which case the new  line
  1601. will be further indented by one tab position.
  1602.  
  1603.     A close brace (}) will delete one tab position preceeding itself
  1604. as  it is typed.  This should line up the close brace with its    matching
  1605. IF, FOR or WHILE statement.
  1606.  
  1607.     A  pound  sign    (#) with only leading whitespace will delete all
  1608. the whitespace preceeding itself. This    will  always  bring preprocessor
  1609. directives flush to the left margin.
  1610.  
  1611.     Whenever any close fence is typed, ie )]>}, if the matching open
  1612. fence is on screen in the current window, the cursor will  breifly flash
  1613. to  it, and then back. This makes  balencing  expresions,  and    matching
  1614. blocks much easier.
  1615.  
  1616.  
  1617. 7.3  CRYPT mode
  1618.  
  1619.  
  1620.     When a buffer is in CRYPT  mode,  it is encrypted whenever it is
  1621. written to a file, and decrypted when it  is  read  from  the file.  The
  1622. encryption key can be specified on the command line with the  -k switch,
  1623. or with the M-E set-encryption-key command.    If you attempt to read or
  1624. write a buffer in crypt mode and now key has not  been    set,  EMACS will
  1625. execute  set-encryption-key automatically, prompting you for the  needed
  1626. key.  Whenever EMACS prompts  you for a key, it will not echo the key to
  1627. your screen as    you  type it (ie make SURE you get it right when you set
  1628. it originally).
  1629.  
  1630.     The encryption algorithm used changes all characters into normal
  1631. printing characters, thus the resulting file is suitable for sending via
  1632. electronic mail.  All  version    of MicroEMACS should be able decrypt the
  1633. resulting file regardless of what  machine encrypted it.  Also available
  1634. with EMACS is the stand  alone program, MicroCRYPT, which can en/decrypt
  1635. the files produced by CRYPT mode in EMACS.
  1636.  
  1637.  
  1638. 7.4  EXACT mode
  1639.  
  1640.  
  1641.     All string searches and replacements will take    upper/lower case
  1642. into account. Normally the case of  a  string during a search or replace
  1643. is not taken into account.
  1644.  
  1645.  
  1646.  
  1647. 24
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654. MicroEMACS Reference Manual                       Modes
  1655.  
  1656.  
  1657. 7.5  MAGIC mode
  1658.  
  1659.  
  1660.     In the    MAGIC mode certain characters gain special meanings when
  1661. used  in  a  search  pattern.     Collectively  they  are know as regular
  1662. expressions, and a limited number of them are  supported  in MicroEmacs.
  1663. They grant greater flexability when  using the search command.    However,
  1664. they do not affect the incremental search command.
  1665.  
  1666.     The symbols that have special meaning in MAGIC mode are ^, $, .,
  1667. *, [ (and ], used with it), and \.
  1668.  
  1669.     The characters ^ and  $  fix the search pattern to the beginning
  1670. and  end  of  line, respectively.  The ^ character must  appear  at  the
  1671. beginning of the search string,  and  the  $  must  appear  at    the end,
  1672. otherwise they loose their  meaning  and are treated just like any other
  1673. character.  For example,  in  MAGIC mode, searching for the pattern "t$"
  1674. would  put the cursor at the end of any line that ended with the  letter
  1675. 't'.  Note that this is  different  than searching for "t<NL>", that is,
  1676. 't' followed by a newline character.  The character $  (and  ^, for that
  1677. matter) matches a position, not a character, so the  cursor  remains  at
  1678. the end of the line.  But a newline is a character that must be matched,
  1679. just like any  other  character,  which  means that the cursor is placed
  1680. just after it - on the beginning of the next line.
  1681.  
  1682.     The character .  has a very simple  meaning  --  it  matches any
  1683. single character, except the newline.  Thus a search for  "bad.er" could
  1684. match "badger", "badder" (slang), or up to the 'r' of "bad error".
  1685.  
  1686.     The character * is known as closure, and means that zero or more
  1687. of  the  preceding  character  will  match.    If  there is no character
  1688. preceding,  * has no special meaning, and since it will not match with a
  1689. newline, * will have no special meaning if preceded by the  beginning of
  1690. line symbol ^ or the literal newline character <NL>.
  1691.  
  1692.     The notion of  zero  or  more  characters is important.  If, for
  1693. example, your cursor was on the line
  1694.  
  1695.       This line is missing two vowels.
  1696.  
  1697.     and a  search  was  made  for  "a*",  the cursor would not move,
  1698. because it is guarenteed to match no letter  'a'  ,  which  satifies the
  1699. search conditions.  If you wanted to  search  for  one    or  more  of the
  1700. letter 'a', you would search for "aa*", which would match the  letter a,
  1701. then zero or more of them.
  1702.  
  1703.     The character [ indicates  the    beginning  of a character class.
  1704. It  is    similar to the 'any' character ., but you get  to  choose  which
  1705. characters you want to match.  The character  class  is  ended    with the
  1706. character ].  So, while a  search  for "ba.e" will match "bane", "bade",
  1707. "bale", "bate",  et  cetera,  you  can    limit  it to matching "babe" and
  1708. "bake" by searching for "ba[bk]e".  Only one of  the  characters  inside
  1709. the [ and ] will match a character.  If in fact you  want  to  match any
  1710. character except those in the character  class,  you  can put a ^ as the
  1711.  
  1712.  
  1713.                                       25
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720. Modes                         MicroEMACS Reference Manual
  1721.  
  1722.  
  1723. first character.  It must be the first character of  the  class, or else
  1724. it has    no  special  meaning.    So, a search for [^aeiou] will match any
  1725. character except a vowel, but a search for [aeiou^] will match any vowel
  1726. or a ^.
  1727.  
  1728.     If you have a lot of characters in order that you want to put in
  1729. the  character class, you may use a dash (-) as a range character.   So,
  1730. [a-z] will match any letter (or any lower case letter  if  EXACT mode is
  1731. on),  and  [0-9a-f]  will match any digit or any letter 'a' through 'f',
  1732. which happen to be the characters for hexadecimal numbers.  If    the dash
  1733. is at the beginning or    end of a character class, it is taken to be just
  1734. a dash.
  1735.  
  1736.     The escape character \ is for those times when you want to be in
  1737. MAGIC  mode,  but  also want to use a regular expression character to be
  1738. just  a  character.   It turns off the special meaning of the character.
  1739. So  a search for "it\." will search for a line with "it.", and not  "it"
  1740. followed by any other character.  The escape character will also let you
  1741. put ^, -, or ] inside a character class with no special side effects.
  1742.  
  1743.  
  1744. 7.6  OVER mode
  1745.  
  1746.  
  1747.     OVER mode stands for overwrite mode.  When in  this  mode,  when
  1748. characters  are  typed,  instead of simply inserting them into the file,
  1749. EMACS  will  attempt  to overwrite an existing character past the point.
  1750. This is very useful for adjusting tables and diagrams.
  1751.  
  1752.  
  1753. 7.7  WRAP mode
  1754.  
  1755.  
  1756.     Wrap mode is used when typing in continuous text.   Whenever the
  1757. cursor is past the currently set fill column  (72  by  default)  and the
  1758. user types a space or  a <NL>, the last word of the line is brought down
  1759. to  the  beginning  of    the  next  line.  Using this, one just    types  a
  1760. continous  stream  of  words and EMACS automatically  inserts  <NL>s  at
  1761. appropriate places.
  1762.  
  1763.               NOTE to programmers:
  1764.  
  1765.       EMACS actually calls up  the  function  bound to the illegal
  1766.       keystroke M-FNW.    This is bound to the function wrap-word by
  1767.       default, but can be re-bound to activate different functions
  1768.       and macros at wrap time.
  1769.  
  1770.  
  1771. 7.8  VIEW mode
  1772.  
  1773.  
  1774.     VIEW mode disables all commands  which    can  change  the current
  1775. buffer.  EMACS will display an error message  and  ring  the  bell every
  1776. time you attempt to change a buffer in VIEW mode.
  1777.  
  1778.  
  1779. 26
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786. MicroEMACS Reference Manual                       Modes
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.                Chapter 7 Summary
  1794.  
  1795.  
  1796.     In Chapter 7 you learned about modes and their effects.
  1797.  
  1798. Key Binding        Keystroke               Effect
  1799. Add-Mode        ^X-M        Add a mode to the current buffer
  1800.  
  1801. Delete-Mode        ^X-^M        Delete a mode from the current buffer
  1802.  
  1803. Add-Global-Mode         M-M        Add a global mode to the
  1804.                     current buffer
  1805.  
  1806. Delete-Global-Mode    M-^M        Delete a global mode from the
  1807.                     current buffer
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.                                       27
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852. Files                         MicroEMACS Reference Manual
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.                    Chapter 8
  1862.  
  1863.                  Files
  1864.  
  1865.  
  1866.     A  file is simply a collection of related data.  In EMACS we are
  1867. dealing with text files -- named collections of text residing on  a disk
  1868. (or some other storage medium).  You will recall that the major entities
  1869. EMACS deals with  are  buffers.    Disk-based versions of files are only
  1870. active in EMACS when you are reading into or writing out of buffers.  As
  1871. we  have  already  seen,  buffers  and    physical  files  are  linked  by
  1872. associated  filenames.      For  example,  the buffer "ch7.txt"  which  is
  1873. associated with the physical disk file "ch7.txt." You  will  notice that
  1874. the file is usually specified by the drive  name  or  (in  the case of a
  1875. hard drive) a path.  Thus you can specify full filenames in EMACS,
  1876.  
  1877.     e.g. disk:\directories\filename.extension
  1878.  
  1879.     If you do not  specify    a disk and directories, the default disk
  1880. is used.
  1881.  
  1882.     IMPORTANT  -- If you do not explicitly save  your  buffer  to  a
  1883. file, all your edits will be  lost  when you leave EMACS (although EMACS
  1884. will prompt you  when  you  are  about    to  lose  edits by exiting).  In
  1885. addition, EMACS  does not protect your disk-based files from overwriting
  1886. when it saves files.  Thus when you  instruct  EMACS  to  save a file to
  1887. disk, it will create a file if the specified file  doesn't  exist, or it
  1888. will overwrite the previously saved version of the  file  thus replacing
  1889. it.  Your old version is gone forever.
  1890.  
  1891.     If you are at all  unsure  about  your    edits,    or  if    (for any
  1892. reason) you wish to keep previous versions of a file, you can change the
  1893. name of the associated file with  the  command    ^X-N.  When this file is
  1894. saved to disk, EMACS will create a new physical file under the new name.
  1895. The earlier disk file will be preserved.
  1896.  
  1897.     For example, let's load the file fang.txt into EMACS.  Now, type
  1898. ^X-N.  The EMACS command line prompts "name:".    Enter a new name for the
  1899. file -- say new.txt and press <NL>.  The file will  be    saved  under the
  1900. new filename, and  your  disk  directory  will    show  both  fang.txt and
  1901. new.txt.
  1902.  
  1903.     An  alternative method is to write the    file  directly    to  disk
  1904. under a new filename.  Let's pull our "publish.txt" file into EMACS.  To
  1905. write this file under  another    filename, type ^X-^W.  EMACS will prompt
  1906. you "write file:".  Enter an alternate filename --  desktop.txt.    Your
  1907. file will be saved as the physical file "desktop.txt".
  1908.  
  1909.  
  1910.  
  1911. 28
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918. MicroEMACS Reference Manual                       Files
  1919.  
  1920.  
  1921.     Note that in the examples above, although you  have  changed the
  1922. names of the related files, the buffer names remain the same.    However,
  1923. when  you pull the physical file back into EMACS, you will find that the
  1924. buffer name now relates to the filename.
  1925.  
  1926.     For example -- You are working with a buffer "fang.txt" with the
  1927. related file "fang.txt".  You change the name of the file  to "new.txt".
  1928. EMACS now shows you  working  with the buffer "fang.txt" and the related
  1929. file  "new.txt".    Now pull the file "new.txt" into EMACS.  Notice that
  1930. the buffer name has now changed to "new.txt".
  1931.  
  1932.     If for any reason a conflict of buffer names occurs,(if you have
  1933. files of  the  same  name  on  different  drives for example) EMACS will
  1934. prompt you "use buffer:".  Enter an alternative buffer name if    you need
  1935. to.
  1936.  
  1937.     For  a    list  of  file    related commands (including  some  we`ve
  1938. already seen), see the summary page.
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.                                       29
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984. Files                         MicroEMACS Reference Manual
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.                Chapter 8 Summary
  1992.  
  1993.  
  1994.     In Chapter 8 you  learned  some of the more advanced concepts of
  1995. file  naming  and  manipulation.    The relationship between  files  and
  1996. buffers was discussed in some detail.
  1997.  
  1998. Key Binding    Keystroke    Effect
  1999.  
  2000. Save-file    ^X-^S        Saves contents of current buffer with
  2001.                 associated filename on default disk/
  2002.                 directory (if not specified)
  2003.  
  2004. Write-File    ^X-^W        Current buffer contents will be
  2005.                 saved under specified name
  2006.  
  2007. Change-File-name
  2008.         ^X-N        The associated filename is changed
  2009.                 (or associated if not previously
  2010.                 specified) as specified
  2011.  
  2012. Find-File    ^X-^F        Reads specified file into buffer and
  2013.                 switches you to that buffer, or switches
  2014.                 to buffer in which the file has previously
  2015.                 been read
  2016.  
  2017. Read-File    ^X-^R        Reads file into buffer thus overwriting
  2018.                 buffer contents.  If file has already
  2019.                 been read into another buffer, you will
  2020.                 be switched to it
  2021.  
  2022. View-File    ^X-^V        The same as read-file except the buffer
  2023.                 is automatically put into VIEW mode thus
  2024.                 preventing any changes from being made
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043. 30
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050. MicroEMACS Reference Manual                   Screen Formatting
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.                    Chapter 9
  2060.  
  2061.                Screen Formatting
  2062.  
  2063.  
  2064. 9.1  Wrapping Text
  2065.  
  2066.  
  2067.     As  we    learned  in  the  introduction,  EMACS    is  not  a  word
  2068. processor, but an editor.   Some simple formatting options are available
  2069. however, although in most  cases  they will not affect the appearence of
  2070. the finished text when it is run through the formatter.  We have already
  2071. encountered WRAP mode which  wraps  lines  longer  than a certain length
  2072. (default is 75 characters).  You will recall  that  WRAP  is  enabled by
  2073. entering ^X-M and responding to the command line prompt with wrap.
  2074.  
  2075.     You can also set your own wrap margin with the command ^X-F set-
  2076. fill-column.  Notice EMACS responds "[Fill column is 1]." Now try typing
  2077. some text.   You'll  notice  some  very strange things happening -- your
  2078. text wraps  at    every  word!!  This  effect  occurs because the set wrap
  2079. margin command must be preceeded by a numeric argument or EMACS  sets it
  2080. to the first column.  Thus any text you type that extends past the first
  2081. column will wrap at the most convenient line break.
  2082.  
  2083.     To reset the wrap column to 72 characters, press the  <META> key
  2084. and enter 72.  EMACS will respond "Arg:  72".     Now  press ^X-F.  EMACS
  2085. will respond "[Fill column is 72]".    Your  text will again wrap at the
  2086. margin you've been using up to this point.
  2087.  
  2088.  
  2089. 9.2  Reformatting Paragraphs
  2090.  
  2091.  
  2092.     After an intensive editing session, you may find  that    you have
  2093. paragraphs  containing    lines  of  differing  lengths.      Although  this
  2094. disparity will not affect  the    formatted  text, aesthetic and technical
  2095. concerns  may  make  it desirable to have consistent paragraph blocks on
  2096. the screen.   If you are in WRAP mode, you can reformat a paragraph with
  2097. the  command  M-Q  fill-paragraph.    This command 'fills'  the  current
  2098. paragraph  reformatting  it  so  all  the  lines  are  filled  and  wrap
  2099. logically.    The  process  is    complex,  and  (especially  with  longer
  2100. paragraphs) may take a little time.
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.                                       31
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116. Screen Formatting                 MicroEMACS Reference Manual
  2117.  
  2118.  
  2119. 9.3  Changing Case
  2120.  
  2121.  
  2122.     There may be occasions when you find it necessary to  change the
  2123. case of the text you've entered.  EMACS allows you to change the case of
  2124. even large amounts of text with ease.  Let's try and  convert  a  few of
  2125. the office traditionalists to the joy  of  word processing.  Type in the
  2126. following text:
  2127.  
  2128.       Throw  away   your  typewriter  and  learn  to  use  a  word
  2129.       processor.   Word processing is relatively easy to learn and
  2130.       will increase  your  productivity  enormously.    Enter  the
  2131.       Computer Age and find out just how much fun it can be!!
  2132.  
  2133.     Let's give it a  little  more  impact  by capitalizing the first
  2134. four words.  The first    step is to define the region of text just as you
  2135. would  if  you were doing an extensive deletion.  Set the  mark  at  the
  2136. beginning of the paragraph with M-<space> set-mark and    move  the cursor
  2137. to the space beyond  "typewriter."  Now  enter    ^X-^U case-region-upper.
  2138. Your text should now look like this:
  2139.  
  2140.       THROW  AWAY   YOUR  TYPEWRITER  and  learn  to  use  a  word
  2141.       processor.   Word processing is relatively easy to learn and
  2142.       will increase  your  productivity  enormously.    Enter  the
  2143.       Computer Age and find out just how much fun it can be!!
  2144.  
  2145.     If  you  want  to change the text back to lower case, type ^X-^L
  2146. case-region-lower.    You  can    also  capitalize individual words.    To
  2147. capitalize the word "fun", position the cursor in front of the    word and
  2148. type  M-U  case-word-upper.   The word is now capitalized.  To change it
  2149. back to lower case, move the  cursor  back  to the beginning of the word
  2150. and type M-L case-word-lower.
  2151.  
  2152.     You  may  also    capitalize  individual    letters in EMACS.    The
  2153. command M-C case-word-capitalize capitalizes the first letter  after the
  2154. point.    This command would normally be issued with the cursor positioned
  2155. in front of the first letter of the word you wish to capitalize.  If you
  2156. issue it  in  the  middle  of  a  word, you can end up with some strAnge
  2157. looking text.
  2158.  
  2159.  
  2160. 9.4  Tabs
  2161.  
  2162.  
  2163.     Unless    your  formatter  is  instructed  to  take   screen  text
  2164. literally  (as    MicroSCRIBE  does  in  the  'verbatim'    environment  for
  2165. example), tabs in EMACS generally affect screen formatting only.
  2166.  
  2167.     When EMACS is first started, it sets the default  tab  to  every
  2168. eighth column.    As long as you stay with default,  every  time you press
  2169. the tab key a tab character, ^I is inserted.  This character, like other
  2170. control  characters,  is  invisible  --   but  it  makes  a  subtle  and
  2171. significant difference to your file and editing.
  2172.  
  2173.  
  2174.  
  2175. 32
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182. MicroEMACS Reference Manual                   Screen Formatting
  2183.  
  2184.  
  2185.     For example, in default mode, press the tab key  and  then  type
  2186. the word Test.    "Test" appears at the eighth column.    Move your cursor
  2187. to the beginning of the word and delete  the  backward    character.   The
  2188. word doesn't  move  back  just    one  character,  but flushes to the left
  2189. margin.    The    reason for this behavior is easily explained.     In  tab
  2190. default, EMACS inserts    a  'real'  tab    character when you press the tab
  2191. key.  This character is inserted at the default position, but  NO SPACES
  2192. are inserted between the  tab  character and the margin (or previous tab
  2193. character).  As you will  recall, EMACS only recognizes characters (such
  2194. as  spaces  or    letters) and thus when the tab character is removed, the
  2195. text beyond the tab is flushed back to the margin or previous tab mark.
  2196.  
  2197.     This situation changes if you alter  the  default configuration.
  2198. The default value may  be  changed by entering a numeric argument before
  2199. pressing  the  tab key.  As we saw earlier, pressing the  META    key  and
  2200. entering a  number  allows  you  to  specify  how EMACS performs a given
  2201. action.   In this case, let's specify an argument of 10 and hit the  tab
  2202. key.
  2203.  
  2204.     Now hit the tab key again  and    type  Test.  Notice the word now
  2205. appears at the    tenth column.  Now move to the beginning of the word and
  2206. delete the backward character. "Test" moves back by one character.
  2207.  
  2208.     EMACS behaves differently in these circumstances because  the ^I
  2209. handle-tab function deals with tabbing in two distinct ways.  In default
  2210. conditions,  or  if  the  numeric  argument of zero is used,  handle-tab
  2211. inserts a true tab character.  If, however, a non-zero    numeric argument
  2212. is specified, handle-tab inserts the  correct number of spaces needed to
  2213. position the cursor at the next specified tab  position.    It    does NOT
  2214. insert the single tab character and hence any  editing    functions should
  2215. take account of the number of spaces between tabbed columns.
  2216.  
  2217.     Many times you would like to take a line which has  been created
  2218. using the tab character and change it to use just  spaces.   The command
  2219. ^X-^D  detab-line  changes  any tabs from the point to the  end  of  the
  2220. current line into the right  number  of  spaces  so  the  line    does not
  2221. change.  This is very usefull for times when the file must be printed or
  2222. transfered to a machine which does not understand tabs.
  2223.  
  2224.     Also, the inverse command,  ^X-^E  entab-lines    changes multiple
  2225. spaces to tabs where possible.    This is a good way to shrink the size of
  2226. large documents, escpecially with data tables.    Both  of  these commands
  2227. can  take  a  numeric argument which will be interpeted as the number of
  2228. lines to en/detab.
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.                                       33
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248. Screen Formatting                 MicroEMACS Reference Manual
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.                Chapter 9 Summary
  2256.  
  2257.  
  2258.     In  Chapter  9    introduced some of the    formatting  features  of
  2259. EMACS. Text-wrap, paragraph reformatting,  and    tabs  were  discussed in
  2260. some  detail.     The commands in the following table were covered in the
  2261. chapter.
  2262.  
  2263.  
  2264. Key Binding        Keystroke            Effect
  2265. Add-Mode/WRAP        ^X-M[WRAP]    Add wrap mode to current buffer
  2266.  
  2267. Delete-Mode/WRAP    ^X-^M[WRAP]    Remove wrap mode from current buffer
  2268.  
  2269. Set-Fill-Column         ^X-F        Set fill column to given numeric
  2270.                     argument
  2271.  
  2272. Fill-Paragraph        M-Q        Logically reformats the current
  2273.                     paragraph
  2274.  
  2275. Case-Word-Upper         M-U        Text from point to end of the
  2276.                     current word is changed to uppercase
  2277.  
  2278. Case-Word-Lower         M-L        Text from point to end of the
  2279.                     current word is changed to lowercase
  2280.  
  2281. Case-Word-Capitalize    M-C        First word (or letter) after the
  2282.                     point is capitalized
  2283.  
  2284. Case-Region-Upper    ^X-^U        The current region is uppercased
  2285.  
  2286. Case-Region-Lower    ^X-^L        The current region is lowercased
  2287.  
  2288. Handle-Tab        ^I        Tab interval is set to the given
  2289.                     numeric argument
  2290. Entab-Line        ^X-^E        Changes multiple spaces to tabs
  2291.                     characters where possible
  2292. Detab-Line        ^X-^D        Changes tab characters to the
  2293.                     apprpriate number of spaces
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307. 34
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314. MicroEMACS Reference Manual                 Keyboard Macros
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.  
  2321.  
  2322.  
  2323.                    Chapter 10
  2324.  
  2325.                 Keyboard Macros
  2326.  
  2327.  
  2328.     In many applications, it may be necessary to repeat a  series of
  2329. characters or commands frequently.  For example, a paper may require the
  2330. frequent repetition of a complex formula or a long name.    You may also
  2331. have a series of EMACS commands that you invoke  frequently.    Keyboard
  2332. macros    offer  a  convenient  method  of recording and    repeating  these
  2333. commands.
  2334.  
  2335.     Imagine,  for  example,  you are writing a  scholarly  paper  on
  2336. Asplenium platyneuron, the spleenwort fern.  Even the dedicated botanist
  2337. would  probably  find  it  a  task  bordering  on  the agonizing to type
  2338. Asplenium platyneuron frequently throughout the paper.      An alternative
  2339. method is 'record' the name in a keyboard macro.  Try it yourself.
  2340.  
  2341.     The  command  ^X-(  begin-macro  starts  recording  the  all the
  2342. keystrokes  and  commands  you input.    After  you've  typed  it,  enter
  2343. Asplenium platyneuron.    To stop recording, type ^X-)  end-macro.   EMACS
  2344. has stored all the keystrokes between  the  two commands.  To repeat the
  2345. name  you've  stored,  just  enter  ^X-E  execute-macro,  and  the  name
  2346. "Asplenium platyneuron" appears.  You can repeat this action as often as
  2347. you want, and of course as  with  any  EMACS command, you may preceed it
  2348. with a numerical argument.
  2349.  
  2350.     Because  EMACS    records  keystrokes,  you  may    freely    intermix
  2351. commands and text.  Unfortunately, you can only  store    one  macro  at a
  2352. time.     Thus, if you begin to    record    another  macro,  the  previously
  2353. defined macro is lost. Be careful to ensure that  you've  finished  with
  2354. one macro before defining another.  If you  have  a  series  of commands
  2355. that  you  would  like    to  'record'  for  future use, use the macro  or
  2356. procedure facilities detailed in chapter <X>.
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373.                                       35
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380. Keyboard Macros                              MicroEMACS Reference Manual
  2381.  
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.                Chapter 10 Summary
  2388.  
  2389.  
  2390.     Chapter 10 covered keyboard macros.  You learned  how  to record
  2391. keystrokes and how to repeat the stored sequence.
  2392.  
  2393. Key Binding        Keystroke        Effect
  2394.  
  2395. Start-Macro        ^X-(        Starts recording all keyboard input
  2396.  
  2397. End-Macro        ^X-)        Stops recording keystrokes for macro
  2398.  
  2399. Execute-Macro        ^X-E        Entire sequence of recorded
  2400.                     keystrokes is replayed
  2401.  
  2402.  
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439. 36
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446. MicroEMACS Reference Manual                   MicroEMACS Macros
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455.                    Chapter 11
  2456.  
  2457.                MicroEMACS Macros
  2458.  
  2459.  
  2460.     Macros are programs that are used to customize the editor and to
  2461. perform complicated  editing  tasks.    They  may  be stored in files or
  2462. buffers and may be executed using an appropriate command, or bound  to a
  2463. particular  keystroke.      Portions  of    the standard start-up  file  are
  2464. impliment via macros, as well as the example menu system.   The execute-
  2465. macro-<n>  commands  cause  the  macro,  numbered  from  1  to 40, to be
  2466. executed.  The execute-file command allows you to execute a macro stored
  2467. in a disk file, and the  execute-buffer  command allows you to execute a
  2468. macro  stored  in  a buffer.  Macros are stored for  easy  execution  by
  2469. executing files that contain the store-macro command.
  2470.  
  2471.     There are many different aspects  to  the  macro  langage within
  2472. MicroEMACS.  Editor commands  are  the    various commands that manipulate
  2473. text, buffers, windows, etc, within the editor.  Directives are commands
  2474. which  control    what  lines get executed within a macro.  Also there are
  2475. various types of variables.    Environmental  variables both control and
  2476. report on different aspects  of  the editor.  User variables hold string
  2477. values which may be changed and inspected.  Buffer variables  allow text
  2478. to be placed into variables.  Interactive variable allow the  program to
  2479. prompt the user for information.  Functions can be  used  to  manipulate
  2480. all these variables.
  2481.  
  2482.  
  2483. 11.1  Variables
  2484.  
  2485.  
  2486.     Variables  in MicroEMACS can be used  to  return  values  within
  2487. expressions,  as repeat counts to editing commands, or    as  text  to  be
  2488. inserted into buffers and messages.  The value of these variables is set
  2489. using the set  (^X-A)  command.    For    example, to set the current fill
  2490. column to 64 characters, the following macro line would be used:
  2491.  
  2492.     set $fillcol 64
  2493.  
  2494.     or  to    have  the contents of %name inserted at the point in the
  2495. current buffer, the command to use would be:
  2496.  
  2497.     insert-string %name
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.                                       37
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512. MicroEMACS Macros                 MicroEMACS Reference Manual
  2513.  
  2514.  
  2515.  
  2516. 11.1.1    Environmental Variables
  2517.  
  2518.  
  2519.     "What good is a quote if you can't change it?"
  2520.  
  2521.     These variables are used to  change different aspects of the way
  2522. the editor works.  Also they will return the current settings if used as
  2523. part of an  expresion.      All  environmental variable names begin with a
  2524. dollar sign ($) and are in lower case.
  2525.  
  2526. $fillcol     Current fill column
  2527.  
  2528. $pagelen     Number of screen lines used currently
  2529.  
  2530. $curwidth     Number of columns used currently
  2531.  
  2532. $curcol          Current column of point in current buffer
  2533.  
  2534. $curline     Current line of point in current buffer
  2535.  
  2536. $flicker     Flicker Flag set to TRUE if IBM CGA set  to  FALSE  for
  2537.          most others
  2538.  
  2539. $cbufname     Name of the current buffer
  2540.  
  2541. $cfname          File name of the current buffer
  2542.  
  2543. $sres         Current screen resolution (CGA, MONO or EGA on the IBM-
  2544.          PC  driver. LOW, MEDIUM, HIGH or  DENSE  on  the  Atari
  2545.          ST1040, NORMAL on all others)
  2546.  
  2547. $debug         Flag to trigger macro debugging (try it...  you'll like
  2548.          it!)
  2549.  
  2550. $status          return status    of the success of the last command (TRUE
  2551.          or FALSE) usually used with !force
  2552.  
  2553. $palette     string used to control the palette register settings on
  2554.          graphics versions. The  usually form consists of groups
  2555.          of three  octal digits setting the red, green, and blue
  2556.          levels.
  2557.  
  2558. $asave         The number  of  inserted  characters  between automatic
  2559.          file-saves in ASAVE mode.
  2560.  
  2561. $acount          The  coundown    of inserted characters    until  the  next
  2562.          save-file.
  2563.  
  2564. $lastkey     Last keyboard character typed
  2565.  
  2566. $curchar     Character currently at the point
  2567.  
  2568.  
  2569.  
  2570.  
  2571. 38
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578. MicroEMACS Reference Manual                   MicroEMACS Macros
  2579.  
  2580.  
  2581. $discmd          Flag to  disable the echoing of messages on the command
  2582.          line
  2583.  
  2584. $version     Contains the current MicroEMACS version number
  2585.  
  2586. $progname     Always  contains  the    string "MicroEMACS" for standard
  2587.          MicroEMACS. Could  be something else if used as part of
  2588.          someone else's program
  2589.  
  2590. $seed         integer seed of the random number generator
  2591.  
  2592. $disinp          Flag  to  disable  the  echoing  of  characters  during
  2593.          command line input
  2594.  
  2595.     Obviously, many more of these  variables  will    be  availible in
  2596. future releases of MicroEMACS.    (Yes,  send a vote for your favorite new
  2597. environmental variables today).
  2598.  
  2599.  
  2600. 11.1.2    User variables
  2601.  
  2602.  
  2603.     User  variables  allow    you,  the  user,  to  store strings  and
  2604. manipulate them.  These strings can be pieces of text, numbers    (in text
  2605. form), or the logical values TRUE and FALSE.    These  variables  can be
  2606. combined, tested, inserted  into  buffers, and otherwise used to control
  2607. the way your macros execute.   At  the    moment, up to 100 user variables
  2608. may be    in  use  in  one editing session.  All users variable names must
  2609. begin with a percent  sign  (%) and may contain any printing characters.
  2610. Only the first 10 characters  are significant (ie differences beyond the
  2611. tenth character are ignored).  Most operators will truncate strings to a
  2612. length of 128 characters.
  2613.  
  2614.  
  2615. 11.1.3    Buffer Variables
  2616.  
  2617.  
  2618.     Buffer    variables  are    special in that they can only be queried
  2619. and cannot be set.  What buffer variables are is a way to take text from
  2620. a buffer and place it  in a variable. For example, if I have a buffer by
  2621. the name of RIGEL2, and it contains the text:
  2622.  
  2623.     Richmond
  2624.     Lafayette
  2625.     <*>Bloomington        (where <*> is the current point)
  2626.     Indianapolis
  2627.     Gary
  2628.     =* MicroEMACS 3.8i (WRAP) == rigel2 == File: /data/rigel2.txt =====
  2629.  
  2630.     and within a command I reference #rigel2, like:
  2631.  
  2632.     insert-string #rigel2
  2633.  
  2634.  
  2635.  
  2636.  
  2637.                                       39
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644. MicroEMACS Macros                 MicroEMACS Reference Manual
  2645.  
  2646.  
  2647.     MicroEMACS would start at the current point in the RIGEL2 buffer
  2648. and  grab  all the text up to the end of that line and pass  that  back.
  2649. Then it would advance the point to the beginning of the next line. Thus,
  2650. after our  last command executes, the string "Bloomington" gets inserted
  2651. into the current buffer, and the buffer RIGEL2 now looks like this:
  2652.  
  2653.     Richmond
  2654.     Lafayette
  2655.     Bloomington
  2656.     <*>Indianapolis         (where <*> is the current point)
  2657.     Gary
  2658.     =* MicroEMACS 3.8i (WRAP) == rigel2 == File: /data/rigel2.txt =====
  2659.  
  2660.     as you have probably noticed,  a buffer variable consists of the
  2661. buffer name, preceded by a pound sign (#).
  2662.  
  2663.  
  2664. 11.1.4    Interactive variables
  2665.  
  2666.  
  2667.     Interactive variables are  actually  a method to prompt the user
  2668. for a string.  This is done by using an at sign (@) followed either with
  2669. a quoted string, or a variable containing a string.   The  string is the
  2670. placed on the  bottom line, and the editor waits for the user to type in
  2671. a string.  Then the  string  typed  in    by  the users is returned as the
  2672. value of the interactive variable.  For example:
  2673.  
  2674.     set %quest "What file? "
  2675.     find-file @%quest
  2676.  
  2677.     will ask the user for a file name, and then attempt to find it.
  2678.  
  2679.  
  2680. 11.2  Functions
  2681.  
  2682.  
  2683.     Functions can be  used    to manipulate variables in various ways.
  2684. Functions can have one,  two,  or three arguments.  These arguments will
  2685. always    be  placed  after the function on the current command line.  For
  2686. example, if we wanted to increase the current fill column by  two, using
  2687. emacs's set (^X-A) command, we would write:
  2688.  
  2689.     set $fillcol &add $fillcol 2
  2690.      \    \      \      \     \____second operand
  2691.       \     \    \      \_________first operand
  2692.        \      \     \_______________function to execute
  2693.         \       \_____________________variable to set
  2694.          \___________________________set (^X-A) command
  2695.  
  2696.     Function names always begin with  the  ampresand  (&) character,
  2697. and  are  only    significant to the  first  three  characters  after  the
  2698. ampresand.    Functions  will  normal  expect  one  of    three  types  of
  2699. arguments, and will automatically convert types when needed.
  2700.  
  2701.  
  2702.  
  2703. 40
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710. MicroEMACS Reference Manual                   MicroEMACS Macros
  2711.  
  2712.  
  2713. <num>         an  ascii string of digits which  is  interpeted  as  a
  2714.          numeric value.  Any string  which does not start with a
  2715.          digit or a minus sign (-) will be considered zero.
  2716.  
  2717. <str>         An arbitrary string  of  characters.     At  the moment,
  2718.          strings are limited to 128 characters in length.
  2719.  
  2720. <log>         A logical value  consisting  of  the  string  "TRUE" or
  2721.          "FALSE".  Numeric strings will also evaluate to "FALSE"
  2722.          if they are equal to zero, and "TRUE" if they    are non-
  2723.          zero.    Arbitrary text    strings  will  have the value of
  2724.          "FALSE".
  2725.  
  2726.     A list    of  the  currently  availible  functions  follows: (Once
  2727. again, send in those votes on what kind of functions  you  would like to
  2728. see  added!)  Functions  are  always  used in lower case, the  uppercase
  2729. letters in the function table are the short  form  of  the  function (ie
  2730. &div for ÷).
  2731.  
  2732. Numeric Functions:    (returns <num>)
  2733.  
  2734. &ADD        <num> <num>    Add two numbers
  2735. &SUB        <num> <num>    Subtract the second number from the first
  2736. &TIMes        <num> <num>    Multiply two numbers
  2737. &DIVide         <num> <num>    Divide the first number by the second
  2738.                 giving an integer result
  2739. &MOD        <num> <num>    Return the reminder of dividing the
  2740.                 first number by the second
  2741. &NEGate         <neg>        Multiply the arg by -1
  2742. &LENgth         <str>        Returns length of string
  2743. &ASCii        <str>        Return the ascii code of the first
  2744.                 character in <str>
  2745. &RND        <num>        Returns a random integer between 1 and <num>
  2746. &ABS        <num>        Returns the absolute value of <num>
  2747.  
  2748. String manipulation functions:    (returns <str>)
  2749.  
  2750. &CAT        <str> <str>    Concatinate the two strings to form one
  2751. &LEFt        <str> <num>    return the <num> leftmost characters
  2752.                 from <str>
  2753. &RIGht        <str> <num>    return the <num> rightmost characters
  2754.                 from <str>
  2755. &MID        <str> <num1> <num2>
  2756.                 Starting from <num1> position in <str>,
  2757.                 return <num2> characters.
  2758. &UPPer        <str>        Uppercase <str>
  2759. &LOWer        <str>        lowercase <str>
  2760. &CHR        <num>        return a string with the character
  2761.                 represented by ascii code <num>
  2762. >K                return a string containing a single
  2763.                 keystroke from the user
  2764.  
  2765. Logical Testing functions:    (returns <log>)
  2766.  
  2767.  
  2768.  
  2769.                                       41
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776. MicroEMACS Macros                 MicroEMACS Reference Manual
  2777.  
  2778.  
  2779. &NOT        <log>        Return the opposite logical value
  2780. &AND        <log1> <log2>    Returns TRUE if BOTH logical arguments
  2781.                 are TRUE
  2782. &OR        <log1> <log2>    Returns TRUE if either argument
  2783.                 is TRUE
  2784. &EQUal        <num> <num>    If <num> and <num> are numerically
  2785.                 equal, return TRUE
  2786. &LESs        <num1> <num2>    If <num1> is less than <num2>, return
  2787.                 TRUE.
  2788. &GREater    <num1> <num2>    If <num1> is greater than, or equal to
  2789.                 <num2>, return TRUE.
  2790. &SEQual         <str1> <str2>    If the two strings are the same, return
  2791.                 TRUE.
  2792. &SLEss        <str1> <str2>    If <str1> is less alphabetically than
  2793.                 <str2>, return TRUE.
  2794. &SGReater    <str1> <str2>    If <str1> is alphabetically greater than
  2795.                 or equal to <str2>, return TRUE.
  2796.  
  2797. Special Functions:
  2798.  
  2799. &INDirect    <str>        Evaluate <str> as a variable.
  2800.  
  2801.     This last function deserves more explanation. The  &IND function
  2802. evaluates its argument, takes the resulting string, and then uses  it as
  2803. a variable name.  For example, given the following code sequence:
  2804.  
  2805.     ; set up reference table
  2806.  
  2807.     set %one    "elephant"
  2808.     se    "giraffe"
  2809.     set %t    "donkey"
  2810.  
  2811.     set %index "two"
  2812.     insert-string &ind %index
  2813.  
  2814.     the  string  "giraffe"    would have been inserted at the point in
  2815. the current buffer.  This indirection  can  be safely nested up to about
  2816. 10 levels.
  2817.  
  2818.  
  2819. 11.3  Directives
  2820.  
  2821.  
  2822.     Directives are commands which only operate  within  an executing
  2823. macro,    ie  they do not make sense as a single command.  As  such,  they
  2824. cannot be called up singly or bound to keystroke.  Used  within  macros,
  2825. they control what lines are executed and in what order.
  2826.  
  2827.     Directives always start with the exclamation mark  (!) character
  2828. and must be the first thing placed on a line. Directives executed singly
  2829. (via the execute-command-line command) interactively will be ignored.
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835. 42
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842. MicroEMACS Reference Manual                   MicroEMACS Macros
  2843.  
  2844.  
  2845.  
  2846. 11.3.1    !ENDM Directive
  2847.  
  2848.  
  2849.     This  directive  is  used to terminate a macro being stored. For
  2850. example, if a file is being executed contains the text:
  2851.  
  2852.     ;    Read in a file in view mode, and make the window red
  2853.  
  2854.     26    store-macro
  2855.         find-file @"File to view: "
  2856.         add-mode "view"
  2857.         add-mode "red"
  2858.     !endm
  2859.  
  2860.     write-message "[Consult macro has been loaded]"
  2861.  
  2862.     only the lines between the  store-macro  command  and  the !ENDM
  2863. directive are stored in macro 26.
  2864.  
  2865.  
  2866. 11.3.2    !FORCE Directive
  2867.  
  2868.  
  2869.     When  MicroEMACS executes a macro, if  any  command  fails,  the
  2870. macro is terminated at that point.  If    a  line is preceeded by a !FORCE
  2871. directive, execution  continues weather the command succeeds or not. For
  2872. example:
  2873.  
  2874.     ;    Merge the top two windows
  2875.  
  2876.     save-window        ;remember what window we are at
  2877.     1 next-window        ;go to the top window
  2878.     delete-window        ;merge it with the second window
  2879.     !force restore-window    ;This will continue irregardless
  2880.     add-mode "red"
  2881.  
  2882.  
  2883. 11.3.3    !IF, !ELSE, and !ENDIF Directives
  2884.  
  2885.  
  2886.     This  directive  allows  statements  only  to be executed  if  a
  2887. condition specified in the  directive  is met.    Every line following the
  2888. !IF directive, until  the  first  !ELSE  or  !ENDIF  directive,  is only
  2889. executed if the expresion  following  the  !IF    directive evaluates to a
  2890. TRUE value.   For  example,  the  following  macro  segment  creates the
  2891. portion of a text file automatically.  (yes  believe  me,  this  will be
  2892. easier to understand then that last explanation....)
  2893.  
  2894.     !if &sequal %curplace "timespace vortex"
  2895.         insert-string "First, rematerialize~n"
  2896.     !endif
  2897.     !if &sequal %planet "earth"    ;If we have landed on earth...
  2898.  
  2899.  
  2900.  
  2901.                                       43
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908. MicroEMACS Macros                 MicroEMACS Reference Manual
  2909.  
  2910.  
  2911.         !if &sequal %time "late 20th century"  ;and we are then
  2912.             write-message "Contact U.N.I.T."
  2913.         !else
  2914.             insert-string "Investigate the situation....~n"
  2915.             insert-string "(SAY 'stay here Sara')~n"
  2916.         !endif
  2917.     !else
  2918.         set %conditions @"Atmosphere conditions outside? "
  2919.         !if &sequal %conditions "safe"
  2920.             insert-string &cat "Go outside......" "~n"
  2921.             insert-string "lock the door~n"
  2922.         !else
  2923.             insert-string "Dematerialize..try somewhen else"
  2924.             newline
  2925.         !endif
  2926.     !endif
  2927.  
  2928.  
  2929. 11.3.4    !GOTO Directive
  2930.  
  2931.  
  2932.     Flow can be controlled within a MicroEMACS macro using the !GOTO
  2933. directive. It takes as an argument a label. A label  consists  of a line
  2934. starting  with an asterick (*) and then an  alphanumeric  label.    Only
  2935. labels in the currently executing macro can be jumped to, and  trying to
  2936. jump to  a  non-existing  label  terminates  execution    of a macro.  For
  2937. example..
  2938.  
  2939.     ;Create a block of DATA statements for a BASIC program
  2940.  
  2941.         insert-string "1000 DATA "
  2942.         set %linenum 1000
  2943.  
  2944.     *nxtin
  2945.         update-screen        ;make sure we see the changes
  2946.         set %data @"Next number: "
  2947.         !if &equal %data 0
  2948.             !goto finish
  2949.         !endif
  2950.  
  2951.         !if &greater $curcol 60
  2952.             2 delete-previous-character
  2953.             newline
  2954.             set %linenum &add %linenum 10
  2955.             insert-string &cat %linenum " DATA "
  2956.         !endif
  2957.  
  2958.         insert-string &cat %data ", "
  2959.         !goto nxtin
  2960.  
  2961.     *finish
  2962.  
  2963.         2 delete-previous-character
  2964.  
  2965.  
  2966.  
  2967. 44
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974. MicroEMACS Reference Manual                   MicroEMACS Macros
  2975.  
  2976.  
  2977.         newline
  2978.  
  2979.  
  2980. 11.3.5    !RETURN Directive
  2981.  
  2982.  
  2983.     The !RETURN Directive  causes  the current macro to exit, either
  2984. returning to the caller (if any) or to interactive mode.  For example:
  2985.  
  2986.     ;    Check the monitor type and set %mtyp
  2987.  
  2988.     !if &sres "CGA"
  2989.         set %mtyp 1
  2990.         !return
  2991.     !else
  2992.         set %mtyp 2
  2993.     !endif
  2994.  
  2995.     insert-string "You are on a MONOCHROME machine!~n"
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.                                       45
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040. MicroEMACS commands                 MicroEMACS Reference Manual
  3041.  
  3042.  
  3043.  
  3044.  
  3045.  
  3046.  
  3047.  
  3048.  
  3049.                    Appendix A
  3050.  
  3051.               MicroEMACS commands
  3052.  
  3053.  
  3054.     Below  is a complete list of the commands  in  EMACS,  the  keys
  3055. normally used to do the command,  and  what the command does.  Remember,
  3056. on some computers there may also  be  additional ways of using a command
  3057. (cursor keys and special function keys for example).
  3058.  
  3059. Command                         Binding         Meaning
  3060. abort-command         ^G    This allows the user to abort out of any
  3061.                 command that is waiting for input
  3062.  
  3063. add-mode         ^X-M    Add a mode to the current buffer
  3064.  
  3065. add-global-mode          M-M    Add a global mode for all new buffers
  3066.  
  3067. apropos                  M-A    List out commands whose name contains
  3068.                 the string specified
  3069.  
  3070. backward-character     ^B    Move one character to the left
  3071.  
  3072. begin-macro         ^X-(    Begin recording a keyboard macro
  3073.  
  3074. beginning-of-file     M-<    Move to the beginning of the file in
  3075.                 the current buffer
  3076.  
  3077. beginning-of-line     ^A    Move to the beginning of the current line
  3078.  
  3079. bind-to-key         M-K    Bind a key to a function
  3080.  
  3081. buffer-position          ^X-=    List the position of the cursor in the
  3082.                 current window on the command line
  3083.  
  3084. case-region-lower     ^X-^L    Make a marked region all lower case
  3085.  
  3086. case-region-upper     ^X-^U    Make a marked region all upper case
  3087.  
  3088. case-word-capitalize     M-C    Capitalize the following word
  3089.  
  3090. case-word-lower          M-L    Lower case the following word
  3091.  
  3092. case-word-upper          M-U    Upper case the following word
  3093.  
  3094. change-file-name     ^X-N    Change the name of the file in the
  3095.                 current buffer
  3096.  
  3097.  
  3098.  
  3099. 46
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106. MicroEMACS Reference Manual                 MicroEMACS commands
  3107.  
  3108.  
  3109. change-screen-size     M-^S    Chnage the number of lines of the screen
  3110.                 currently being used
  3111.  
  3112. change-screen-width     M-^T    Change the number of columns of the
  3113.                 screen currently being used
  3114.  
  3115. clear-and-redraw     ^L    Clear the physical screen and redraw it
  3116.  
  3117. clear-message-line    (none)    Clear the command line
  3118.  
  3119. copy-region         M-W    Copy the currently marked region into
  3120.                 the kill buffer
  3121.  
  3122. count-words         M-^C    Count how many words, lines and
  3123.                 characters are in the current marked region
  3124.  
  3125. ctlx-prefix         ^X    Change the key used as the ^X prefix
  3126.  
  3127. delete-blank-lines     ^X-^O    Delete all blank lines around the cursor
  3128.  
  3129. delete-buffer         ^X-K    Delete a buffer which is not being
  3130.                 currently displayed in a window
  3131.  
  3132. delete-mode         ^X-^M    Turn off a mode in the current buffer
  3133.  
  3134. delete-global-mode     M-^M    Turn off a global mode
  3135.  
  3136. delete-next-character     ^D    Delete the character following the cursor
  3137.  
  3138. delete-next-word     M-D    Delete the word following the cursor
  3139.  
  3140. delete-other-windows     ^X-1    Make the current window cover the entire
  3141.                 screen
  3142.  
  3143. delete-previous-character^H    Delete the character to the left of the
  3144.                 cursor
  3145.  
  3146. delete-previous-word     M-^H    Delete the word to the left of the cursor
  3147.  
  3148. delete-window         ^X-0    Remove the current window from the screen
  3149.  
  3150. describe-bindings    (none)    Make a list of all legal commands
  3151.  
  3152. describe-key         ^X-?    Describe what command is bound to a
  3153.                 keystroke sequence
  3154.  
  3155. detab-line         ^X-^D    Change all tabs in a line to the
  3156.                 equivilant spaces
  3157.  
  3158. end-macro         ^X-)    stop recording a keyboard macro
  3159.  
  3160. end-of-file         M->    Move cursor to the end of the current buffer
  3161.  
  3162. end-of-line         ^E    Move to the end of the current line
  3163.  
  3164.  
  3165.                                       47
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172. MicroEMACS commands                 MicroEMACS Reference Manual
  3173.  
  3174.  
  3175. entab-line         ^X-^E    Change multiple spaces to tabs where
  3176.                 possible
  3177.  
  3178. exchange-point-and-mark  ^X-^X    Move cursor to the last marked spot,
  3179.                 make the original position be marked
  3180.  
  3181. execute-buffer        (none)    Execute a buffer as a macro
  3182.  
  3183. execute-command-line    (none)    Execute a line typed on the command
  3184.                 line as a macro command
  3185.  
  3186. execute-file         FNB    Execute a file as a macro
  3187.  
  3188. execute-macro         ^X-E    Execute the keyboard macro (play back
  3189.                 the recorded keystrokes)
  3190. execute-macro-<n>    (none)    Execute numbered macro <N> where <N> is
  3191.                 an integer from 1 to 40
  3192.  
  3193. execute-named-command     M-X    Execute a command by name
  3194.  
  3195. execute-procedure     M-^E    Execute a procedure by name
  3196.  
  3197. exit-emacs         ^X-^C    Exit EMACS. If there are unwritten,
  3198.                 changed buffers EMACS will ask to confirm
  3199.  
  3200. fill-paragraph         M-Q    Fill the current paragraph
  3201.  
  3202. filter-buffer         ^X-#    Filter the current buffer through an
  3203.                 external filter
  3204.  
  3205. find-file         ^X-^F    Find a file to edit in the current window
  3206.  
  3207. forward-character     ^F    Move cursor one character to the right
  3208.  
  3209. goto-line         M-G    Goto a numbered line
  3210.  
  3211. goto-matching-fence     M-^F    Goto the matching fence
  3212.  
  3213. grow-window         ^X-^    Make the current window larger
  3214.  
  3215. handle-tab         ^I    Insert a tab or set tab stops
  3216.  
  3217. hunt-forward         FN=    Hunt for the next match of the last
  3218.                 search string
  3219.  
  3220. hunt-backward         FN>    Hunt for the last match of the last
  3221.                 search string
  3222.  
  3223. help             M-?    Read EMACS.HLP into a buffer and display it
  3224.  
  3225. i-shell                  ^X-C    Shell up to a new command processor
  3226.  
  3227. incremental-search     ^X-S    Search for a string, incrementally
  3228.  
  3229.  
  3230.  
  3231. 48
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238. MicroEMACS Reference Manual                 MicroEMACS commands
  3239.  
  3240.  
  3241. insert-file         ^X-^I    insert a file at the cursor in the
  3242.                 current file
  3243.  
  3244. insert-space         ^C    Insert a space to the right of the cursor
  3245.  
  3246. insert-string        (none)    Insert a string at the cursor
  3247.  
  3248. kill-paragraph         M-^W    Delete the current paragraph
  3249.  
  3250. kill-region         ^W    Delete the current marked region, moving
  3251.                 it to the kill buffer
  3252.  
  3253. kill-to-end-of-line     ^K    Delete the rest of the current line
  3254.  
  3255. list-buffers         ^X-^B    List all existing buffers
  3256.  
  3257. meta-prefix         <ESC>    Key used to preceed all META commands
  3258.  
  3259. move-window-down     ^X-^N    Move all the lines in the current window down
  3260.  
  3261. move-window-up         ^X-^P    Move all the lines in the current window up
  3262.  
  3263. name-buffer         M-^N    Change the name of the current buffer
  3264.  
  3265. newline                  ^M    Insert a <NL> at the cursor
  3266.  
  3267. newline-and-indent     ^J    Insert a <NL> at the cursor and indent
  3268.                 the new line the same as the preceeding line
  3269.  
  3270. next-buffer         ^X-X    Bring the next buffer in the list into
  3271.                 the current window
  3272.  
  3273. next-line         ^N    Move the cursor down one line
  3274.  
  3275. next-page         ^V    Move the cursor down one page
  3276.  
  3277. next-paragraph         M-N    Move cursor to the next paragraph
  3278.  
  3279. next-window         ^X-O    Move cursor to the next window
  3280.  
  3281. next-word         M-F    Move coursor to the beginning of the
  3282.                 next word
  3283.  
  3284. open-line         ^O    Open a line at the cursor
  3285.  
  3286. pipe-command         ^X-@    Execute an external command and place
  3287.                 its output in a buffer
  3288.  
  3289. previous-line         ^P    Move cursor up one line
  3290.  
  3291. previous-page         ^Z    Move cursor up one page
  3292.  
  3293. previous-paragraph     M-P    Move back one paragraph
  3294.  
  3295.  
  3296.  
  3297.                                       49
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304. MicroEMACS commands                 MicroEMACS Reference Manual
  3305.  
  3306.  
  3307. previous-window          ^X-P    Move the cursor to the last window
  3308.  
  3309. previous-word         M-B    Move the cursor to the beginning of the
  3310.                 word to the left of the cursor
  3311.  
  3312. query-replace-string     M-^R    Reaplace all of one string with another
  3313.                 string, interactivly quering the user
  3314.  
  3315. quick-exit         M-Z    Exit EMACS, writing out all changed buffers
  3316.  
  3317. quote-character          ^Q    Insert the next character literally
  3318.  
  3319. read-file         ^X-^R    Read a file into the current buffer
  3320.  
  3321. redraw-display         M-^L    Redraw the display, centering the
  3322.                 current line
  3323.  
  3324. resize-window         ^X-W    Change the number of lines in the
  3325.                 current window
  3326.  
  3327. restore-window        (none)    Move cursor to the last saved window
  3328.  
  3329. replace-string         M-R    Replace all occurences of one string
  3330.                 with another string from the cursor
  3331.                 to the end of the buffer
  3332.  
  3333. reverse-incremental-search^X-R    Search backwards, incrementally
  3334.  
  3335. run             M-^E    Execute a named procedure
  3336.  
  3337. save-file         ^X-^S    Save the current buffer if it is changed
  3338.  
  3339. save-window        (none)    Remember current window (to restore later)
  3340.  
  3341. scroll-next-up         M-^Z    Scroll the next window up
  3342.  
  3343. scroll-next-down     M-^V    Scroll the next window down
  3344.  
  3345. search-forward         ^S    Search for a string
  3346.  
  3347. search-reverse         ^R    Search backwards for a string
  3348.  
  3349. select-buffer         ^X-B    Select a buffer to display in the
  3350.                 current window
  3351.  
  3352. set             ^X-A    Set a variable to a value
  3353.  
  3354. set-encryption-key     M-E    Set the encryption key of the current buffer
  3355.  
  3356. set-fill-column          ^X-F    Set the current fill column
  3357.  
  3358. set-mark            Set the mark
  3359.  
  3360. shell-command         ^X-!    Execute an external command
  3361.  
  3362.  
  3363. 50
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370. MicroEMACS Reference Manual                 MicroEMACS commands
  3371.  
  3372.  
  3373. shrink-window         ^X-^Z    Make the current window smaller
  3374.  
  3375. split-current-window     ^X-2    Split the current window in two
  3376.  
  3377. store-macro        (none)    Store the following macro lines to a
  3378.                 numbered macro
  3379.  
  3380. store-procedure         (none)    Store the following macro lines to a
  3381.                 named procedure
  3382.  
  3383. transpose-characters     ^T    Transpose the character at the cursor
  3384.                 with the character to the left
  3385.  
  3386. trim-line         ^X-^T    Trim any trailing whitespace from line
  3387.  
  3388. unbind-key         M-^K    Unbind a key from a function
  3389.  
  3390. universal-argument     ^U    Execute the following command 4 times
  3391.  
  3392. unmark-buffer         M-~    Unmark the current buffer (so it is
  3393.                 no longer changed)
  3394.  
  3395. update-screen        (none)    Force a screen update during macro execution
  3396.  
  3397. view-file         ^X-^V    Find a file,and put it in view mode
  3398.  
  3399. wrap-word         M-FNW    Wrap the current word, this is an
  3400.                 internal function
  3401.  
  3402. write-file         ^X-^W    Write the current buffer under a new
  3403.                 file name
  3404.  
  3405. write-message        (none)    Display a string on the command line
  3406.  
  3407. yank             ^Y    yank the kill buffer into the current
  3408.                 buffer at the cursor
  3409.  
  3410.  
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.  
  3423.  
  3424.  
  3425.  
  3426.  
  3427.  
  3428.  
  3429.                                       51
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436. MicroEMACS Bindings                 MicroEMACS Reference Manual
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.  
  3445.                    Appendix B
  3446.  
  3447.               MicroEMACS Bindings
  3448.  
  3449.  
  3450.     Below is a complete list of the key bindings used in MicroEMACS.
  3451. This can be used as a wall chart reference for MicroEMACS commands.
  3452.  
  3453.               Default Key Bindings for MicroEmacs 3.8i
  3454.  
  3455.  ^A   Move to start of line          ESC A   Apropos (list some commands)
  3456.  ^B   Move backward by characters     ESC B   Backup by words
  3457.  ^C   Insert space              ESC C   Initial capitalize word
  3458.  ^D   Forward delete              ESC D   Delete forward word
  3459.  ^E   Goto end of line              ESC E   Reset Encryption Key
  3460.  ^F   Move forward by characters      ESC F   Advance by words
  3461.  ^G   Abort out of things          ESC G   Go to a line
  3462.  ^H   Backward delete
  3463.  ^I   Insert tab/Set tab stops
  3464.  ^J   Insert CR-LF, then indent
  3465.  ^K   Kill forward              ESC K   Bind Key to function
  3466.  ^L   Refresh the screen          ESC L   Lower case word
  3467.  ^M   Insert CR-LF              ESC M   Add global mode
  3468.  ^N   Move forward by lines          ESC N   Goto End paragraph
  3469.  ^O   Open up a blank line
  3470.  ^P   Move backward by lines          ESC P   Goto Begining of paragraph
  3471.  ^Q   Insert literal              ESC Q   Fill current paragraph
  3472.  ^R   Search backwards              ESC R   Search and replace
  3473.  ^S   Search forward
  3474.  ^T   Transpose characters
  3475.  ^U   Repeat command four times       ESC U   Upper case word
  3476.  ^V   Move forward by pages          ESC V   Move backward by pages
  3477.  ^W   Kill region              ESC W   Copy region to kill buffer
  3478.  ^Y   Yank back from killbuffer       ESC X   Execute named command
  3479.  ^Z   Move backward by pages          ESC Z   Save all buffers and exit
  3480.  
  3481.  ESC ^C   Count words in region       ESC ~   Unmark current buffer
  3482.  ESC ^F   Goto matching fence          ESC !   Reposition window
  3483.  ESC ^H   Delete backward word          ESC <   Move to start of buffer
  3484.  ESC ^K   Unbind Key from function    ESC >   Move to end of buffer
  3485.  ESC ^L   Reposition window          ESC .   Set mark
  3486.  ESC ^M   Delete global mode          ESC space    Set mark
  3487.  ESC ^N   Rename current buffer       ESC rubout   Delete backward word
  3488.  ESC ^R   Search & replace w/query      rubout   Backward delete
  3489.  ESC ^S   Change screen rows
  3490.  ESC ^T   Change screen columns
  3491.  ESC ^V   Scroll next window down
  3492.  ESC ^W   Delete Paragraph
  3493.  
  3494.  
  3495. 52
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502. MicroEMACS Reference Manual                 MicroEMACS Bindings
  3503.  
  3504.  
  3505.  ESC ^Z   Scroll next window up
  3506.  
  3507.  ^X ?    Describe a key           ^X !   Run 1 command in a subjob
  3508.  ^X =    Show the cursor position   ^X @    Pipe DOS command to buffer
  3509.  ^X ^    Enlarge display window       ^X #   Filter buffer thru DOS filter
  3510.  ^X 0    Delete current window       ^X (   Begin macro
  3511.  ^X 1    Delete other windows       ^X )   End macro
  3512.  ^X 2    Split current window
  3513.                    ^X A   Set variable value
  3514.  ^X ^B     Display buffer list       ^X B   Switch a window to a buffer
  3515.  ^X ^C     Exit MicroEMACS       ^X C   Start a new command processer
  3516.                    ^X D   Suspend MicroEMACS (BSD4.2 only)
  3517.                    ^X E   Execute macro
  3518.  ^X ^F     Find file           ^X F   Set fill column
  3519.  ^X ^I     Insert file
  3520.                    ^X K   Delete buffer
  3521.  ^X ^L     Lower case region
  3522.  ^X ^M     Delete Mode           ^X M   Add a mode
  3523.  ^X ^N     Move window down       ^X N   Rename current filename
  3524.  ^X ^O     Delete blank lines       ^X O   Move to the next window
  3525.  ^X ^P     Move window up            ^X P   Move to the previous window
  3526.  ^X ^R     Get a file from disk       ^X R   Incremental reverse search
  3527.  ^X ^S     Save current file       ^X S   Incremental forward search
  3528.  ^X ^U     Upper case region
  3529.  ^X ^V     View file
  3530.  ^X ^W     Write a file to disk       ^X W   resize Window
  3531.  ^X ^X     Swap "." and mark       ^X X   Use next buffer
  3532.  ^X ^Z     Shrink window           ^X Z   Enlarge display window
  3533.  
  3534. Only under PCDOS:
  3535.  <ALT>-S Hunt forward         SHIFT <F1> - <F10>
  3536.  <ALT>-R Hunt backward         Execute macroes 1 - 10
  3537.  
  3538. Usable Modes
  3539. WRAP     Lines going past right margin "wrap" to a new line
  3540. VIEW     Read-Only mode where no modifications are allowed
  3541. CMODE     Change behavior of some commands to work with C better
  3542. EXACT     Exact case matching on search strings
  3543. OVER     Overwrite typed characters instead of inserting them
  3544. CRYPT     Current buffer will be encrypted on write, decrypted on read
  3545. MAGIC     Use regular expresion matching in searches
  3546. ASAVE     Save the file every 256 inserted characters
  3547.  
  3548. WHITE/CYAN/MAGENTA/YELLOW/BLUE/RED/GREEN/BLACK    Sets forground color
  3549. white/cyan/magenta/yellow/blue/red/green/black    Sets background color
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.                                       53
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568. Supported machines                 MicroEMACS Reference Manual
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575.  
  3576.  
  3577.                    Appendix C
  3578.  
  3579.                Supported machines
  3580.  
  3581.  
  3582.     The following table lists all the hardware/compilers for which I
  3583. currently support MicroEMACS.    This  is  not  exclusive of all machines
  3584. which MicroEMACS will  run on, but I have either run it myself, or had a
  3585. first hand report of it running.
  3586.  
  3587. Hardware    OS        Compiler    Comments
  3588. VAX 780         UNIX V5         native
  3589.         UNIX V7         native
  3590.         BSD 4.2         native        job control supported
  3591.         *VMS        native        only some terminals supported
  3592.  
  3593. NCR Tower    UNIX V5         native
  3594.  
  3595. Fortune 32:16    UNIX V7         native
  3596.  
  3597. IBM-PC        MSDO        LATTICE 2.15    Large CODE/Large DATA
  3598.          2.0 & 3.2    AZTEC 3.4e    Small CODE/Large DATA
  3599.                 *MSC 4.0
  3600.                 *MWC 86
  3601.  
  3602. HP150        MSDOS        Lattice 2.15    Function key labels
  3603.                         for the touch screen
  3604.  
  3605. HP110        MSDOS        Lattice 2.15
  3606.                 Aztec 3.4e
  3607.  
  3608. *Data General 10
  3609.         MSDOS        Lattice 2.15
  3610.  
  3611. *Texas Instruments Professional
  3612.         MSDOS        Lattice 2.15
  3613.  
  3614. Amiga        Intuition    Lattice 3.03    no mouse or menus yet
  3615.                 *Aztec 3
  3616.  
  3617. ST520        TOS        Lattice 3.10    no menus yet,
  3618.                         no shell commands
  3619.  
  3620. Systems to be supported (ie some code is already written:)
  3621. Macintosh    Finder 5.0    Aztec
  3622.  
  3623. *means that I do not own or have access to the listed compiler and/or
  3624.  machine and must rely upon others to help support it.
  3625.  
  3626.  
  3627. 54
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634. MicroEMACS Reference Manual             Machine Dependent Notes
  3635.  
  3636.  
  3637.  
  3638.  
  3639.  
  3640.  
  3641.  
  3642.  
  3643.                    Appendix D
  3644.  
  3645.             Machine Dependent Notes
  3646.  
  3647.  
  3648.     This   appendix   lists   some     notes    specific  to  individual
  3649. implementations  of MicroEMACS. Every attempt has  been  made  to  allow
  3650. EMACS to be identical on all  machines,  but  we have also tried to take
  3651. advantage of function keys, cursor  keys, mice, and special screen modes
  3652. where possible.
  3653.  
  3654.  
  3655. D.1  IBM-PC/XT/AT and its clones
  3656.  
  3657.  
  3658.     The  IBM-PC  family  of computers is supported with a variety of
  3659. different display adapters.  EMACS will attempt to discover what adapter
  3660. is connected and use the proper driver for it. Below is  a  list  of the
  3661. currently supported video adapters:
  3662.  
  3663. Adapter                         $sres        Original mode used
  3664. Monochrome Graphics Adapter    MONO        MONO
  3665. Color Graphics Adapter        CGA        CGA
  3666. Enhanced graphics Adapter    EGA        CGA
  3667.  
  3668.     EMACS also takes advatage of  various function keys and the keys
  3669. on the keypad on an IBM-PC.  The function keys    are  initially not bound
  3670. to any particular functions (except by the emacs.rc  startup  file), but
  3671. the keypad keys do default to the following:
  3672.  
  3673. Keypad key    Function
  3674. Home        beginning-of-file
  3675. CSRS UP         previous-line
  3676. Pg Up        previous-page
  3677. CSRS LEFT    backward-character
  3678. CSRS RIGHT    forward-character
  3679. End        end-of-file
  3680. CSRS DOWN    next-line
  3681. Pg Dn        Next-page
  3682.  
  3683.     All these special keys are indicated in EMACS macroes by  use of
  3684. the FN prefix.    Below is a list of many of the keys and  the  codes used
  3685. to specify them.  Also the codes may be gotten by using the describe-key
  3686. (^X ?) command on the suspect key.
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692.  
  3693.                                       55
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700. Machine Dependent Notes                      MicroEMACS Reference Manual
  3701.  
  3702.  
  3703.             IBM PC function keys in MicroEmacs
  3704.  
  3705.     function    Function    ^function    Alt-function
  3706.  f1)      FN;          FNT          FN^          FNh
  3707.  f2)      FN<          FNU          FN_          FNi
  3708.  f3)      FN=          FNV          FN`          FNj
  3709.  f4)      FN>          FNW          FNa          FNk
  3710.  f5)      FN?          FNX          FNb          FNl
  3711.  f6)      FN@          FNY          FNc          FNm
  3712.  f7)      FNA          FNZ          FNd          FNn
  3713.  f8)      FNB          FN[          FNe          FNo
  3714.  f9)      FNC          FN\          FNf          FNp
  3715. f10)      FND          FN]          FNg          FNq
  3716.  
  3717. home)      FNG                  FNw
  3718. CuUp)      FNH
  3719. PgUp)      FNI                  FNä {Alt 132}
  3720. CuLf)      FNK                  FNs
  3721.  5  )
  3722. CuRt)      FNM                  FNt
  3723.  End)      FNO                  FNu
  3724. CuDn)      FNP
  3725. PgDn)      FNQ                  FNv
  3726.  Ins)      FNR
  3727.  Del)      FNS
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759. 56
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766. MicroEMACS Reference Manual             Machine Dependent Notes
  3767.  
  3768.  
  3769.  
  3770.  
  3771. D.2  Atari 520/1040ST
  3772.  
  3773.  
  3774.     The ATARI ST family of computers have a dual personality.   They
  3775. may use either a monochrome or a color screen. EMACS supports two screen
  3776. resolutions on each monitor.
  3777.  
  3778. Monitor $sres size #color $palette format
  3779. Color    LOW    40x25    16    000111222333444555666777
  3780.     MEDIUM    80x25    4    000111222333
  3781. Mono    HIGH    80x25    2    000
  3782.     DENSE    80x40    2    000
  3783.  
  3784.     The $palette environment variable can  be  used  to  change what
  3785. color  is  associated  with each color name.  With a color monitor, each
  3786. group  of three digits indicates an octal  number  specifying  the  RED,
  3787. GREEN  and BLUE levels of that color.  Each color digit can vary from  0
  3788. to  7.      For example, the initial setting of $palette in LOW resolution
  3789. is:
  3790.  
  3791.     000700070770007707077777
  3792.  
  3793.     which broken up is:
  3794.  
  3795.     000 700 070 770 007 707 077 777
  3796.  
  3797.     which means:
  3798.  
  3799.     000    Black
  3800.     700    Red
  3801.     070    Green
  3802.     770    Yellow
  3803.     007    Blue
  3804.     707    Magenta
  3805.     077    Cyan
  3806.     777    White
  3807.  
  3808.       Note: DENSE mode is not yet  supported  in 3.8i.    It will be
  3809.       soon
  3810.  
  3811.     Also the mouse generates FN prefix codes when moved, or when one
  3812. of  the  two  buttons is pressed. Initially the movement of the mouse is
  3813. bound to movement of the cursor,  and  the left mouse button generates a
  3814. set-mark (M-space) command.   The  cursor keys and the function keys are
  3815. bound similarly to to IBM-PC.
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.                                       57
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832. Machine Dependent Notes                      MicroEMACS Reference Manual
  3833.  
  3834.  
  3835.  
  3836.  
  3837. D.3  Amiga 1000
  3838.  
  3839.  
  3840.     The Commodore AMIGA 1000 version  of  MicroEMACS  does    not have
  3841. extensive support of the mouse or of pull down menus as of yet.  It does
  3842. however come up in a  window, and it is possible to re-size it to run in
  3843. different sized  windows.  The M-^S change-screen-size takes its numeric
  3844. argument as the  new number of lines for EMACS to use.    The M-^T change-
  3845. screen-width  command  allows  you to change the number of columns EMACS
  3846. will  use.  The defaults for these are 23 lines and 77 characters across
  3847. for a full screen window.
  3848.  
  3849.             Note about Compiling MicroEMACS
  3850.  
  3851.           If you are compiling the    sources  on  the  AMIGA to
  3852.       produce an executable  image,  and you are using the Lattice
  3853.       compiler,  be sure to give the  CLI  command  'STACK  40000'
  3854.       before compiling to make sure  the  compiler  has sufficient
  3855.       stack space to successfully complete compiliation.
  3856.  
  3857.  
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.  
  3878.  
  3879.  
  3880.  
  3881.  
  3882.  
  3883.  
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891. 58
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898. MicroEMACS Reference Manual             Machine Dependent Notes
  3899.  
  3900.  
  3901.  
  3902.  
  3903. D.4  UNIX V5, V7, and BSD4.[23]
  3904.  
  3905.  
  3906.     MicroEMACS under UNIX utilizes the  TERMCAP  library  to provide
  3907. machine  independent  screen  functions.    Make  sure    that termcap  is
  3908. availible  and properly set on your account  before  attempting  to  use
  3909. MicroEMACS.
  3910.  
  3911.     Under  systems    which  support job control, you can use the ^X-D
  3912. suspend-emacs command to place EMACS  into the background.  This carries
  3913. a much smaller overhead than bringing up a new shell under EMACS.  EMACS
  3914. will properly redraw the screen when you bring it back to the forground.
  3915.  
  3916.     With the addition of some very machine/operating system specific
  3917. code, EMACS can prevent two or more people from modifying the  same file
  3918. at the same  time. The upper level of a set of functions to provide file
  3919. locking  exist    in the source file LOCK.C.    It  requires  two  machine
  3920. specific  functions  written  and  linked  into EMACS for it to  operate
  3921. properly.
  3922.  
  3923.     char *dolock(fname)
  3924.  
  3925.     char *fname;
  3926.  
  3927.     dolock() locks a file, preventing others from modifying it. If
  3928.     it succeeds, it returns NULL, otherwise it returns a pointer to
  3929.     a string in the form "LOCK ERROR: explination".
  3930.  
  3931.     char *undolock(fname)
  3932.  
  3933.     char *fname;
  3934.  
  3935.     undolock() unlocks a file, allowing others to modifying it. If
  3936.     it succeeds, it returns NULL, otherwise it returns a pointer to
  3937.     a string in the form "LOCK ERROR: explination".
  3938.  
  3939.  
  3940.  
  3941.  
  3942.  
  3943.  
  3944.  
  3945.  
  3946.  
  3947.  
  3948.  
  3949.  
  3950.  
  3951.  
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.                                       59
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964. Index                         MicroEMACS Reference Manual
  3965.  
  3966.  
  3967.  
  3968.  
  3969.  
  3970.  
  3971.  
  3972.  
  3973.                     Index
  3974.  
  3975.  
  3976.      <NL> 12            end-of-file 4
  3977.                     end-of-line 4
  3978.      A                entab-lines 33
  3979.      add-global-mode 23        execute-buffer 37
  3980.      add-mode 3, 23                 execute-file 37
  3981.                     execute-macro 35
  3982.      B                execute-macro-<n> 37
  3983.      backward-character 4        exit-emacs 8
  3984.      begin-macro 35
  3985.      beginning-of-file 4, 7         F
  3986.      beginning-of-line 4        file-file 17
  3987.      buffer 4, 6            file locking 59
  3988.      buffers 20            fill-paragraph 7, 31
  3989.                     fill column 26
  3990.      C                find-file 18, 20
  3991.      case-region-lower 32        forward-character 4
  3992.      case-word-capitalize
  3993.           32            H
  3994.      case-word-lower 32        handle-tab 33
  3995.      case-word-upper 32
  3996.      change-screen-size 58        K
  3997.      change-screen-width 58         kill-region 9
  3998.      color 23            kill-to-end-of-line 8
  3999.      control-x 1            kill buffer 10
  4000.      control key 1
  4001.      copy-region 10                 L
  4002.      cursor keys 4            list-buffers 21, 23
  4003.  
  4004.      D                M
  4005.      default string 13        mark 9
  4006.      delete-blank-lines 8        meta key 1
  4007.      delete-buffer 21        mode line 2, 6
  4008.      delete-global-mode 23        modes 3, 23
  4009.      delete-mode 23                 move-window-down 18
  4010.      delete-next-character        move-window-up 18
  4011.           8
  4012.      delete-next-word 8        N
  4013.      delete-previous-        newline 1
  4014.           character 7        next-buffer 20
  4015.      delete-previous-word 8         next-line 3
  4016.      detab-line 33            next-paragraph 4
  4017.  
  4018.      E                O
  4019.      encryption 24            open-line 7
  4020.      end-macro 35
  4021.  
  4022.  
  4023. 60
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030. MicroEMACS Reference Manual                       Index
  4031.  
  4032.  
  4033.                     select-buffer 20
  4034.      P                set-encryption-key 24
  4035.      point 9            set-fill-column 31
  4036.      previous-line 3        set-mark 9
  4037.      previous-paragraph 4        special keys 1
  4038.      previous-window 17        split-current-window
  4039.      previous-word 3             17
  4040.                     suspend-emacs 59
  4041.      Q
  4042.      query-replace 14        T
  4043.      query-replace-string        tab handling 33
  4044.           14            termcap 59
  4045.                     text window 2
  4046.      R
  4047.      replace-string 13        W
  4048.                     window 6
  4049.      S                windows 2, 17
  4050.      save-file 4            wrap-word 26
  4051.      screen 6            wrapping text 31
  4052.      scroll-next-down 18        write-file 4
  4053.      scroll-next-up 18
  4054.      search-forward 12        Y
  4055.      search-reverse 13        yank 10
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069.  
  4070.  
  4071.  
  4072.  
  4073.  
  4074.  
  4075.  
  4076.  
  4077.  
  4078.  
  4079.  
  4080.  
  4081.  
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.                                       61
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.  
  4100.  
  4101.  
  4102.                  Table of Contents
  4103.  
  4104.  
  4105.  
  4106.  
  4107.  
  4108.       Chapter 1  Basic Concepts                                  1
  4109.      1.1  Keys and the Keyboard  . . . . . . . . . . . . . . 1
  4110.      1.2  Getting Started  . . . . . . . . . . . . . . . . . 1
  4111.      1.3  Parts and Pieces . . . . . . . . . . . . . . . . . 2
  4112.      1.4  Entering Text  . . . . . . . . . . . . . . . . . . 2
  4113.      1.5  Basic cursor movement  . . . . . . . . . . . . . . 3
  4114.      1.6  Saving your text . . . . . . . . . . . . . . . . . 4
  4115.  
  4116.       Chapter 2  Basic Editing--Simple Insertions and Deletions  6
  4117.      2.1  A Word About Windows, Buffers, Screens, and
  4118.      Modes . . . . . . . . . . . . . . . . . . . . . . . . . 6
  4119.      2.2  Insertions . . . . . . . . . . . . . . . . . . . . 7
  4120.      2.3  Deletions  . . . . . . . . . . . . . . . . . . . . 7
  4121.  
  4122.       Chapter 3  Using Regions                                   9
  4123.      3.1  Defining and Deleting a Region . . . . . . . . . . 9
  4124.      3.2  Yanking a Region . . . . . . . . . . . . . . . .  10
  4125.  
  4126.       Chapter 4  Search and Replace                             12
  4127.      4.1  Forward Search . . . . . . . . . . . . . . . . .  12
  4128.      4.2  Exact Searches . . . . . . . . . . . . . . . . .  13
  4129.      4.3  Backward Search  . . . . . . . . . . . . . . . .  13
  4130.      4.4  Searching and Replacing  . . . . . . . . . . . .  13
  4131.      4.5  Query-Replace  . . . . . . . . . . . . . . . . .  14
  4132.  
  4133.       Chapter 5  Windows                                        17
  4134.      5.1  Creating Windows . . . . . . . . . . . . . . . .  17
  4135.      5.2  Deleting Windows . . . . . . . . . . . . . . . .  18
  4136.      5.3  Resizing Windows . . . . . . . . . . . . . . . .  18
  4137.      5.4  Other Window commands  . . . . . . . . . . . . .  18
  4138.  
  4139.       Chapter 6  Buffers                                        20
  4140.  
  4141.       Chapter 7  Modes                                          23
  4142.      7.1  ASAVE mode . . . . . . . . . . . . . . . . . . .  23
  4143.      7.2  CMODE mode . . . . . . . . . . . . . . . . . . .  24
  4144.      7.3  CRYPT mode . . . . . . . . . . . . . . . . . . .  24
  4145.      7.4  EXACT mode . . . . . . . . . . . . . . . . . . .  24
  4146.      7.5  MAGIC mode . . . . . . . . . . . . . . . . . . .  25
  4147.      7.6  OVER mode  . . . . . . . . . . . . . . . . . . .  26
  4148.      7.7  WRAP mode  . . . . . . . . . . . . . . . . . . .  26
  4149.      7.8  VIEW mode  . . . . . . . . . . . . . . . . . . .  26
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.                     i
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.       Chapter 8  Files                                          28
  4166.  
  4167.       Chapter 9  Screen Formatting                              31
  4168.      9.1  Wrapping Text  . . . . . . . . . . . . . . . . .  31
  4169.      9.2  Reformatting Paragraphs  . . . . . . . . . . . .  31
  4170.      9.3  Changing Case  . . . . . . . . . . . . . . . . .  31
  4171.      9.4  Tabs . . . . . . . . . . . . . . . . . . . . . .  32
  4172.  
  4173.       Chapter 10  Keyboard Macros                               35
  4174.  
  4175.       Chapter 11  MicroEMACS Macros                             37
  4176.      11.1  Variables . . . . . . . . . . . . . . . . . . .  37
  4177.         11.1.1  Environmental Variables  . . . . . . . . .  38
  4178.         11.1.2  User variables . . . . . . . . . . . . . .  39
  4179.         11.1.3  Buffer Variables . . . . . . . . . . . . .  39
  4180.         11.1.4  Interactive variables  . . . . . . . . . .  40
  4181.      11.2  Functions . . . . . . . . . . . . . . . . . . .  40
  4182.      11.3  Directives  . . . . . . . . . . . . . . . . . .  42
  4183.         11.3.1  !ENDM Directive  . . . . . . . . . . . . .  43
  4184.         11.3.2  !FORCE Directive . . . . . . . . . . . . .  43
  4185.         11.3.3  !IF, !ELSE, and !ENDIF Directives  . . . .  43
  4186.         11.3.4  !GOTO Directive  . . . . . . . . . . . . .  44
  4187.         11.3.5  !RETURN Directive  . . . . . . . . . . . .  45
  4188.  
  4189.       Appendix A  MicroEMACS commands                46
  4190.  
  4191.       Appendix B  MicroEMACS Bindings                52
  4192.  
  4193.       Appendix C  Supported machines                54
  4194.  
  4195.       Appendix D  Machine Dependent Notes            55
  4196.      D.1  IBM-PC/XT/AT and its clones  . . . . . . . . . .  55
  4197.      D.2  Atari 520/1040ST . . . . . . . . . . . . . . . .  57
  4198.      D.3  Amiga 1000 . . . . . . . . . . . . . . . . . . .  58
  4199.      D.4  UNIX V5, V7, and BSD4.[23] . . . . . . . . . . .  59
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.  
  4219.  
  4220.  
  4221.                    ii
  4222.  
  4223.  
  4224.  
  4225.